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 {
    String pattern
    Token(String pattern) {
        this.pattern = pattern

Any ideas how to get around this?

David Sharp

Please sign in to leave a comment.