Skip to content

Commit

Permalink
java.g grammar: parse underscore in pointcut as identifier
Browse files Browse the repository at this point in the history
On source level 21 (preview), '_' is no longer scanned as an identifier
but as a token UNDERSCORE. To avoid a compile error, explicitly parse
the token as an identifier. See upstream commit 8398f6c.

Signed-off-by: Alexander Kriegisch <[email protected]>
  • Loading branch information
kriegaex committed Feb 13, 2024
1 parent 4ea8e1c commit 5d2f2ae
Show file tree
Hide file tree
Showing 17 changed files with 585 additions and 575 deletions.
5 changes: 5 additions & 0 deletions org.eclipse.jdt.core.compiler.batch/grammar/java.g
Original file line number Diff line number Diff line change
Expand Up @@ -1172,6 +1172,11 @@ ColonPseudoToken ::= ':'
/.$putCase consumePseudoToken(":"); $break ./
/:$readableName any allowable token in pointcut or type pattern, except ':':/

-- On source level 21 (preview), '_' is no longer scanned as an identifier but as a token UNDERSCORE.
-- To avoid a compile error, explicitly parse the token as an identifier. See upstream commit 8398f6c121.
PseudoToken ::= '_'
/.$putCase consumePseudoTokenIdentifier(); $break ./

PseudoToken ::= JavaIdentifier
/.$putCase consumePseudoTokenIdentifier(); $break ./
/:$readableName allowable token in pointcut or type pattern:/
Expand Down
Loading

0 comments on commit 5d2f2ae

Please sign in to comment.