[ 
https://issues.apache.org/jira/browse/GROOVY-8161?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Paul King updated GROOVY-8161:
------------------------------
    Description: 
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}

  was:
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}


> 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
>
> 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)

Reply via email to