@willbooster/tree-sitter-java 3.0.0 → 3.0.1

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 CHANGED
@@ -9,9 +9,9 @@
9
9
  /// <reference types="tree-sitter-cli/dsl" />
10
10
  // @ts-check
11
11
 
12
- const DIGITS = token(choice('0', seq(/[1-9]/, optional(seq(optional('_'), sep1(/[0-9]+/, /_+/))))));
13
- const DECIMAL_DIGITS = token(sep1(/[0-9]+/, '_'));
14
- const HEX_DIGITS = token(sep1(/[A-Fa-f0-9]+/, '_'));
12
+ const DECIMAL_DIGITS = token(sep1(/[0-9]+/, /_+/));
13
+ const DIGITS = token(choice('0', seq(/[1-9]/, optional(seq(optional(/_+/), DECIMAL_DIGITS)))));
14
+ const HEX_DIGITS = token(sep1(/[A-Fa-f0-9]+/, /_+/));
15
15
 
16
16
  /* eslint-disable no-multi-spaces */
17
17
 
@@ -126,22 +126,22 @@ module.exports = grammar({
126
126
  )),
127
127
 
128
128
  octal_integer_literal: _ => token(seq(
129
- choice('0o', '0O', '0'),
130
- sep1(/[0-7]+/, '_'),
129
+ choice('0o', '0O', seq('0', optional(/_+/))),
130
+ sep1(/[0-7]+/, /_+/),
131
131
  optional(choice('l', 'L')),
132
132
  )),
133
133
 
134
134
  binary_integer_literal: _ => token(seq(
135
135
  choice('0b', '0B'),
136
- sep1(/[01]+/, '_'),
136
+ sep1(/[01]+/, /_+/),
137
137
  optional(choice('l', 'L')),
138
138
  )),
139
139
 
140
140
  decimal_floating_point_literal: _ => token(choice(
141
141
  seq(DECIMAL_DIGITS, '.', optional(DECIMAL_DIGITS), optional(seq((/[eE]/), optional(choice('-', '+')), DECIMAL_DIGITS)), optional(/[fFdD]/)),
142
142
  seq('.', DECIMAL_DIGITS, optional(seq((/[eE]/), optional(choice('-', '+')), DECIMAL_DIGITS)), optional(/[fFdD]/)),
143
- seq(DIGITS, /[eE]/, optional(choice('-', '+')), DECIMAL_DIGITS, optional(/[fFdD]/)),
144
- seq(DIGITS, optional(seq((/[eE]/), optional(choice('-', '+')), DECIMAL_DIGITS)), (/[fFdD]/)),
143
+ seq(DECIMAL_DIGITS, /[eE]/, optional(choice('-', '+')), DECIMAL_DIGITS, optional(/[fFdD]/)),
144
+ seq(DECIMAL_DIGITS, optional(seq((/[eE]/), optional(choice('-', '+')), DECIMAL_DIGITS)), (/[fFdD]/)),
145
145
  )),
146
146
 
147
147
  hex_floating_point_literal: _ => token(seq(
@@ -153,7 +153,7 @@ module.exports = grammar({
153
153
  optional(seq(
154
154
  /[pP]/,
155
155
  optional(choice('-', '+')),
156
- DIGITS,
156
+ DECIMAL_DIGITS,
157
157
  optional(/[fFdD]/),
158
158
  )),
159
159
  )),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@willbooster/tree-sitter-java",
3
- "version": "3.0.0",
3
+ "version": "3.0.1",
4
4
  "description": "Java grammar for tree-sitter",
5
5
  "keywords": [
6
6
  "incremental",
Binary file
package/tree-sitter.json CHANGED
@@ -14,7 +14,7 @@
14
14
  }
15
15
  ],
16
16
  "metadata": {
17
- "version": "3.0.0",
17
+ "version": "3.0.1",
18
18
  "license": "MIT",
19
19
  "description": "Java grammar for tree-sitter",
20
20
  "authors": [