Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-358

Lexer/parser problem with tertiary operator

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 1.0-beta-5
    • 1.0-beta-5
    • lexer, parser
    • None
    • CVS HEAD as of April 3, 2004

    Description

      This works:

      1> a = (true ? ("a" + "b") : "")
      2> print a
      3> go
      ab

      This worked with the old parser, but now fails:

      1> a = (true ? "a" + "b" : "")
      Exception in thread "main" found unexpected token during REDUCE [330]
      at org.codehaus.groovy.syntax.parser.Parser.expression(Parser.java:3093)
      at org.codehaus.groovy.syntax.parser.Parser.statement(Parser.java:1744)
      at org.codehaus.groovy.syntax.parser.Parser.statement(Parser.java:1776)
      at org.codehaus.groovy.syntax.parser.Parser.topLevelStatement(Parser.java:597)
      at org.codehaus.groovy.syntax.parser.Parser.module(Parser.java:367)
      at groovy.ui.InteractiveShell.parse(InteractiveShell.java:385)
      ...

      Attachments

        Activity

          People

            Unassigned Unassigned
            rodcope Rod Cope
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: