You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Jochen Theodorou (JIRA)" <ji...@apache.org> on 2017/04/22 09:43:04 UTC

[jira] [Commented] (GROOVY-8161) Empty statement before semicolon with parrot parser

    [ https://issues.apache.org/jira/browse/GROOVY-8161?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15979836#comment-15979836 ] 

Jochen Theodorou commented on GROOVY-8161:
------------------------------------------

this is getStatements returning null? That should not happen

> Empty statement before semicolon with parrot parser
> ---------------------------------------------------
>
>                 Key: GROOVY-8161
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8161
>             Project: Groovy
>          Issue Type: Bug
>          Components: parser
>    Affects Versions: 3.0
>            Reporter: Paul King
>            Assignee: Daniel Sun
>
> The folowing snippet:
> {code}
> for (foo in []) {;
> }
> {code}
> while a little unusual with the semicolon separating two empty statements (or terminating an empty statement if you look at things that way) should be valid but instead gives:
> {noformat}
> BUG! exception in phase 'conversion' in source unit 'ConsoleScript12' java.lang.NullPointerException
> ...
> Caused by: java.lang.RuntimeException: java.lang.NullPointerException
> 	at groovy.grape.GrabAnnotationTransformation.visit(GrabAnnotationTransformation.java:227)
> ...
> Caused by: java.lang.NullPointerException
> 	at org.codehaus.groovy.ast.CodeVisitorSupport.visitBlockStatement(CodeVisitorSupport.java:37)
> 	at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitBlockStatement(ClassCodeVisitorSupport.java:106)
> ...
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)