groovy

Parser fails when parentheses omitted from constructor

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.0-JSR-5
  • Fix Version/s: 1.0-JSR-6
  • Component/s: parser
  • Labels:
    None
  • Number of attachments :
    0

Description

new Object.f{}

produces

org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed, test.groovy: -1: PARSER BUG: Tried to configure org.codehaus.groovy.ast.expr.ArgumentListExpression with null Node. File: test.groovy @ line -1, column -1.org.codehaus.groovy.antlr.ASTParserException: PARSER BUG: Tried to configure org.codehaus.groovy.ast.expr.ArgumentListExpression with null Node. File: test.groovy @ line -1, column -1.
at org.codehaus.groovy.antlr.AntlrParserPlugin.buildAST(AntlrParserPlugin.java:183)
at org.codehaus.groovy.control.SourceUnit.convert(SourceUnit.java:313)
at org.codehaus.groovy.control.CompilationUnit$3.call(CompilationUnit.java:615)

The method call taking a closure seems to be needed to trigger this bug

Activity

Hide
John Wilson added a comment -

Mr G!

Parse bugs get automatically assigned to James. I have now replaced james with you on all the components which he was resonisible for

Show
John Wilson added a comment - Mr G! Parse bugs get automatically assigned to James. I have now replaced james with you on all the components which he was resonisible for
Hide
blackdrag blackdrag added a comment -

I think there is a construct in Java allowing

new Foo { a=b}

or something like that.. This was recognized by the grammar but unsupported by the ast. I commented that part in the grammar out, so the Lexer will no longer recognize "new Object.f{}" then. You will get a "unexpected token: {" message now

Show
blackdrag blackdrag added a comment - I think there is a construct in Java allowing new Foo { a=b} or something like that.. This was recognized by the grammar but unsupported by the ast. I commented that part in the grammar out, so the Lexer will no longer recognize "new Object.f{}" then. You will get a "unexpected token: {" message now

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: