Skip to content

Commit

Permalink
fix: allow annotations after new but before the type, add cent unicod…
Browse files Browse the repository at this point in the history
…e to identifiers
  • Loading branch information
amaanq committed Aug 16, 2023
1 parent c9ae7f8 commit 7b27867
Show file tree
Hide file tree
Showing 2 changed files with 313 additions and 144 deletions.
3 changes: 2 additions & 1 deletion grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@ module.exports = grammar({

_unqualified_object_creation_expression: $ => prec.right(seq(
'new',
repeat($._annotation),
field('type_arguments', optional($.type_arguments)),
field('type', $._simple_type),
field('arguments', $.argument_list),
Expand Down Expand Up @@ -1224,7 +1225,7 @@ module.exports = grammar({
super: $ => 'super',

// https://docs.oracle.com/javase/specs/jls/se8/html/jls-3.html#jls-IdentifierChars
identifier: $ => /[\p{L}_$][\p{L}\p{Nd}_$]*/,
identifier: $ => /[\p{L}_$][\p{L}\p{Nd}\u00A2_$]*/,

// http://stackoverflow.com/questions/13014947/regex-to-match-a-c-style-multiline-comment/36328890#36328890
comment: $ => choice(
Expand Down
Loading

0 comments on commit 7b27867

Please sign in to comment.