You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PsiBuilder ignores whitespace and comment tokens but we have to use comment token in BNF just to have corresponding IElementType generated.
Even the official documentation for Custom Language has it as example: private item_ ::= (property|COMMENT|CRLF).
In my own grammar I've ended up with an 'orphan' rule and it works fine: private comment ::= COMMENT
If comment tokens doesn't add anything to a parser, shouldn't we stop using them as we do for whitespace tokens. Of course they are necessary for corresponding IElementType generation but we could use an 'orphan' rules for them or even have a predefined com.intellij.psi.TokenType.
The text was updated successfully, but these errors were encountered:
PsiBuilder ignores whitespace and comment tokens but we have to use comment token in BNF just to have corresponding IElementType generated.
Even the official documentation for Custom Language has it as example:
private item_ ::= (property|COMMENT|CRLF)
.In my own grammar I've ended up with an 'orphan' rule and it works fine:
private comment ::= COMMENT
If comment tokens doesn't add anything to a parser, shouldn't we stop using them as we do for whitespace tokens. Of course they are necessary for corresponding IElementType generation but we could use an 'orphan' rules for them or even have a predefined
com.intellij.psi.TokenType
.The text was updated successfully, but these errors were encountered: