@willbooster/tree-sitter-javascript 1.0.5 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/grammar.js +7 -17
- package/package.json +2 -2
- package/tree-sitter-javascript.wasm +0 -0
- package/tree-sitter.json +1 -1
package/grammar.js
CHANGED
|
@@ -153,7 +153,7 @@ module.exports = grammar({
|
|
|
153
153
|
rules: {
|
|
154
154
|
program: ($) => seq(optional($.hash_bang_line), repeat($.statement)),
|
|
155
155
|
|
|
156
|
-
hash_bang_line: () =>
|
|
156
|
+
hash_bang_line: () => /#![^\n\r\u2028\u2029]*/,
|
|
157
157
|
|
|
158
158
|
//
|
|
159
159
|
// Export declarations
|
|
@@ -905,17 +905,7 @@ module.exports = grammar({
|
|
|
905
905
|
|
|
906
906
|
escape_sequence: () =>
|
|
907
907
|
token.immediate(
|
|
908
|
-
seq(
|
|
909
|
-
'\\',
|
|
910
|
-
choice(
|
|
911
|
-
/[^xu0-7]/,
|
|
912
|
-
/[0-7]{1,3}/,
|
|
913
|
-
/x[0-9a-fA-F]{2}/,
|
|
914
|
-
/u[0-9a-fA-F]{4}/,
|
|
915
|
-
/u\{[0-9a-fA-F]+\}/,
|
|
916
|
-
/[\r?][\n\u2028\u2029]/
|
|
917
|
-
)
|
|
918
|
-
)
|
|
908
|
+
seq('\\', choice(/[^xu0-7]/, /[0-7]{1,3}/, /x[0-9a-fA-F]{2}/, /u[0-9a-fA-F]{4}/, /u\{[0-9a-fA-F]+\}/, /\r\n/))
|
|
919
909
|
),
|
|
920
910
|
|
|
921
911
|
// http://stackoverflow.com/questions/13014947/regex-to-match-a-c-style-multiline-comment/36328890#36328890
|
|
@@ -960,15 +950,15 @@ module.exports = grammar({
|
|
|
960
950
|
'[',
|
|
961
951
|
repeat(
|
|
962
952
|
choice(
|
|
963
|
-
seq('\\',
|
|
964
|
-
/[^\]\
|
|
953
|
+
seq('\\', /[^\n\r\u2028\u2029]/), // escaped character
|
|
954
|
+
/[^\]\\\n\r\u2028\u2029]/ // any character besides ']', '\', or a line terminator
|
|
965
955
|
)
|
|
966
956
|
),
|
|
967
957
|
']'
|
|
968
958
|
), // square-bracket-delimited character class
|
|
969
|
-
seq('\\',
|
|
959
|
+
seq('\\', /[^\n\r\u2028\u2029]/), // escaped character
|
|
970
960
|
// oxlint-disable-next-line no-useless-escape -- tree-sitter's regex parser rejects an unescaped `[` in a character class.
|
|
971
|
-
/[^/\\\[\n]/ // any character besides '[', '\', '/',
|
|
961
|
+
/[^/\\\[\n\r\u2028\u2029]/ // any character besides '[', '\', '/', or a line terminator
|
|
972
962
|
)
|
|
973
963
|
)
|
|
974
964
|
)
|
|
@@ -1113,7 +1103,7 @@ module.exports = grammar({
|
|
|
1113
1103
|
method_definition: ($) =>
|
|
1114
1104
|
seq(
|
|
1115
1105
|
repeat(field('decorator', $.decorator)),
|
|
1116
|
-
optional(choice('static', alias(token(seq('static', /\s+/, 'get', /\s
|
|
1106
|
+
optional(choice('static', alias(token(seq('static', /\s+/, 'get', /\s*[\n\r\u2028\u2029]/)), 'static get'))),
|
|
1117
1107
|
optional('async'),
|
|
1118
1108
|
optional(choice('get', 'set', '*')),
|
|
1119
1109
|
field('name', $._property_name),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@willbooster/tree-sitter-javascript",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"description": "JavaScript grammar for tree-sitter",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"incremental",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@willbooster/oxfmt-config": "1.2.2",
|
|
48
48
|
"@willbooster/oxlint-config": "1.4.8",
|
|
49
49
|
"@willbooster/wb": "22.11.5",
|
|
50
|
-
"@willbooster/web-tree-sitter": "1.0.
|
|
50
|
+
"@willbooster/web-tree-sitter": "1.0.7",
|
|
51
51
|
"conventional-changelog-conventionalcommits": "10.4.0",
|
|
52
52
|
"lefthook": "2.1.14",
|
|
53
53
|
"oxfmt": "0.70.0",
|
|
Binary file
|