Skip to content

Commit 14e7605

Browse files
authored
Merge pull request #201 from aspeddro/fix-unpack
allow `unpack` as a valid identifier
2 parents ebf6259 + c31179e commit 14e7605

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

grammar.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ module.exports = grammar({
6666
],
6767
[$._jsx_attribute_value, $.pipe_expression],
6868
[$.function_type_parameters, $.function_type],
69+
[$._reserved_identifier, $.module_unpack]
6970
],
7071

7172
conflicts: $ => [
@@ -1495,7 +1496,8 @@ module.exports = grammar({
14951496
uncurry: $ => '.',
14961497

14971498
_reserved_identifier: $ => choice(
1498-
'async'
1499+
'async',
1500+
'unpack'
14991501
)
15001502
},
15011503
});

queries/highlights.scm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,14 @@
114114
"assert"
115115
"await"
116116
"with"
117-
"unpack"
118117
"lazy"
119118
"constraint"
120119
] @keyword
121120

122121
((function "async" @keyword))
123122

123+
(module_unpack "unpack" @keyword)
124+
124125
[
125126
"if"
126127
"else"

test/corpus/let_bindings.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ let c = #foo
88
let list = 1
99
let a = list
1010
let async = 1
11+
let unpack = 2
1112
export d = 5
1213

1314
---
@@ -25,6 +26,8 @@ export d = 5
2526
(let_binding (value_identifier) (value_identifier)))
2627
(let_declaration
2728
(let_binding (value_identifier) (number)))
29+
(let_declaration
30+
(let_binding (value_identifier) (number)))
2831
(let_declaration
2932
(let_binding (value_identifier) (number))))
3033

0 commit comments

Comments
 (0)