Skip to content

Commit

Permalink
feat: allow reserved identifiers in element_value_pair
Browse files Browse the repository at this point in the history
  • Loading branch information
amaanq committed Dec 21, 2024
1 parent e9db442 commit 391338c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,7 @@ module.exports = grammar({
),

element_value_pair: $ => seq(
field('key', $.identifier),
field('key', choice($.identifier, $._reserved_identifier)),
'=',
field('value', $._element_value),
),
Expand Down
6 changes: 5 additions & 1 deletion test/corpus/expressions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ annotation
================================================================================

@SuppressWarnings(value = "unchecked")
@GwtCompatible(emulated = true)
@GwtCompatible(module = "foo", emulated = true)
class Duck {

}
Expand All @@ -532,6 +532,10 @@ class Duck {
(annotation
(identifier)
(annotation_argument_list
(element_value_pair
(identifier)
(string_literal
(string_fragment)))
(element_value_pair
(identifier)
(true)))))
Expand Down

0 comments on commit 391338c

Please sign in to comment.