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

parsing 'int x = 123' fails

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.0-beta-5
    • None
    • None

    Description

      Chris your changes to the parser will probably fix this. Found by Ted Leung

      l = ["Ted", "Fred", "Jed", "Ned"]
      println l

      int length = 3
      List r = l.findAll

      {|int e | e.length() < length+1 }

      println r.size()
      List r = r.each

      { println it }

      Executing it gives:

      Caught: org.codehaus.groovy.syntax.parser.UnexpectedTokenException: expected <identifier>; found 'int' at 4:1
      org.codehaus.groovy.syntax.parser.UnexpectedTokenException: expected <identifier>; found 'int' at 4:1
      at org.codehaus.groovy.syntax.parser.Parser.throwExpected(Parser.java:3045)
      at org.codehaus.groovy.syntax.parser.Parser.nameReference(Parser.java:998)
      at org.codehaus.groovy.syntax.parser.Parser.primaryExpression(Parser.java:2471)
      at org.codehaus.groovy.syntax.parser.Parser.postfixExpression(Parser.java:2390)

      Attachments

        Activity

          People

            Unassigned Unassigned
            jstrachan James Strachan
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: