[jira] [Commented] (GROOVY-9301) Parser error for enum constant with comma followed by method

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (GROOVY-9301) Parser error for enum constant with comma followed by method

Eric Milles (Jira)

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

Daniel Sun commented on GROOVY-9301:
------------------------------------

I'm trying to fix the issue for Parrot parser

> Parser error for enum constant with comma followed by method
> ------------------------------------------------------------
>
>                 Key: GROOVY-9301
>                 URL: https://issues.apache.org/jira/browse/GROOVY-9301
>             Project: Groovy
>          Issue Type: Bug
>          Components: parser-antlr2, parser-antlr4
>    Affects Versions: 2.4.17, 2.5.8, 3.0.0-rc-1
>            Reporter: Eric Milles
>            Assignee: Eric Milles
>            Priority: Major
>             Fix For: 3.0.0-rc-2
>
>
> Consider the following:
> {code:groovy}
> enum Orientation {
>   LANDSCAPE, PORTRAIT,
>  
>   @Override
>   String toString() {
>      name().toLowerCase().capitalize()
>   }
> }
> println Orientation.values()
> {code}
> Parser error "unexpected token" for comma after PORTRAIT.  Remove comma and no issue.  Parsers support enum with trailing comma (no class members).
> See also GROOVY-4438 and GROOVY-8507



--
This message was sent by Atlassian Jira
(v8.3.4#803005)