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

continue must have semicolon

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Cannot Reproduce
    • None
    • 1.0-beta-6
    • parser
    • None

    Description

      Following code fails

      for (i in 1..10)

      { if (i == 5) continue println(i) }

      Caught: org.codehaus.groovy.syntax.parser.UnexpectedTokenException: expected one of

      { ";", <newline>, or "}

      " }; found '(' at 4:10
      org.codehaus.groovy.syntax.parser.UnexpectedTokenException: expected one of

      { "; ", <newline>, or "}

      " }; found '(' at 4:10
      at org.codehaus.groovy.syntax.parser.Parser.throwExpected(Parser.java:30 96)
      at org.codehaus.groovy.syntax.parser.Parser.endOfStatement(Parser.java:1 60)
      at org.codehaus.groovy.syntax.parser.Parser.endOfStatement(Parser.java:1 78)
      at org.codehaus.groovy.syntax.parser.Parser.continueStatement(Parser.jav a:1831)
      at org.codehaus.groovy.syntax.parser.Parser.statement(Parser.java:1576)

      But this works

      for (i in 1..10)

      { if (i == 5) continue; println(i) }

      Attachments

        Activity

          People

            Unassigned Unassigned
            yuri Yuri Schimke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: