oowekyala / intellij-javacc

JavaCC and JJTree grammar support for the IntelliJ Platform
https://plugins.jetbrains.com/plugin/11431-javacc
MIT License
44 stars 6 forks source link

False positive for special token reference inside another regex #18

Closed oowekyala closed 3 years ago

oowekyala commented 3 years ago

MWE:

PARSER_BEGIN(Example)
public class Example {}
PARSER_END(Example)

SPECIAL_TOKEN : {
      <FOO:   "0" >
}

TOKEN : {
    <BAR: "a" <FOO> > // should be ok, the expansion is inlined
}

void foo(): {}{
    <BAR> // ok
    <FOO> // not ok
}

For now, the <FOO> reference inside the definition of BAR is reported with Token name FOO refers to a non-token (SPECIAL_TOKEN) regular expression, which does not matter inside regex specs