Groovy enum errors being flagged by the IDE

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

Please sign in to leave a comment.