Quantcast
Channel: JetBrains Developer Community : Thread List - IntelliJ IDEA Users
Viewing all articles
Browse latest Browse all 5661

Groovy enum errors being flagged by the IDE

$
0
0

I have a groovy project with an enumeration, and I'm getting spurious errors that seem to indicate that IntelliJ is attempting to parse the file as a Java file rather than a groovy file.

 

';','}' or new line expected.

 

I've pasted the entirety of the enum definition below.  I'm getting this error on each of the enumerated value lines.

 

enum Token {
     NUMBER(/^[+-]?[0-9]*\.?[0-9]*([Ee][+-]?[0-9]+)?$/)
    ,STRING(/^\S+$/)   
    ,SOLID(/^solid$/)
    ,ENDSOLID(/^endsolid$/)
    ,FACET(/^facet$/)
    ,ENDFACET(/^endfacet$/)
    ,NORMAL(/^normal$/)
    ,OUTER(/^outer$/)
    ,LOOP(/^loop$/)
    ,ENDLOOP(/^endloop$/)
    ,VERTEX(/^vertex$/)
   
    String pattern
    Token(String pattern) {
        this.pattern = pattern
    }
}

 

Any ideas how to get around this?

 

Thanks,

David Sharp


Viewing all articles
Browse latest Browse all 5661

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>