@renovatebot/good-enough-parser 1.1.24 → 2.0.0

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.
Files changed (219) hide show
  1. package/README.md +6 -6
  2. package/dist/cjs/index.d.ts +4 -4
  3. package/dist/cjs/index.js +7 -7
  4. package/dist/cjs/lang/groovy.d.ts +6 -6
  5. package/dist/cjs/lang/groovy.js +83 -83
  6. package/dist/cjs/lang/index.d.ts +20 -20
  7. package/dist/cjs/lang/index.js +56 -56
  8. package/dist/cjs/lang/index.js.map +1 -1
  9. package/dist/cjs/lang/python.d.ts +6 -6
  10. package/dist/cjs/lang/python.js +73 -73
  11. package/dist/cjs/lang/scala.d.ts +6 -6
  12. package/dist/cjs/lang/scala.js +71 -71
  13. package/dist/cjs/lang/starlark.d.ts +6 -6
  14. package/dist/cjs/lang/starlark.js +58 -58
  15. package/dist/cjs/lang/types.d.ts +6 -6
  16. package/dist/cjs/lang/types.js +2 -2
  17. package/dist/cjs/lexer/bracket.d.ts +6 -6
  18. package/dist/cjs/lexer/bracket.js +56 -57
  19. package/dist/cjs/lexer/bracket.js.map +1 -1
  20. package/dist/cjs/lexer/comment.d.ts +3 -3
  21. package/dist/cjs/lexer/comment.js +43 -44
  22. package/dist/cjs/lexer/comment.js.map +1 -1
  23. package/dist/cjs/lexer/index.d.ts +5 -5
  24. package/dist/cjs/lexer/index.js +154 -155
  25. package/dist/cjs/lexer/index.js.map +1 -1
  26. package/dist/cjs/lexer/number.d.ts +2 -2
  27. package/dist/cjs/lexer/number.js +17 -18
  28. package/dist/cjs/lexer/number.js.map +1 -1
  29. package/dist/cjs/lexer/operator.d.ts +2 -2
  30. package/dist/cjs/lexer/operator.js +23 -24
  31. package/dist/cjs/lexer/operator.js.map +1 -1
  32. package/dist/cjs/lexer/rules.d.ts +4 -4
  33. package/dist/cjs/lexer/rules.js +74 -74
  34. package/dist/cjs/lexer/rules.js.map +1 -1
  35. package/dist/cjs/lexer/string.d.ts +2 -2
  36. package/dist/cjs/lexer/string.js +180 -181
  37. package/dist/cjs/lexer/string.js.map +1 -1
  38. package/dist/cjs/lexer/symbol.d.ts +2 -2
  39. package/dist/cjs/lexer/symbol.js +17 -18
  40. package/dist/cjs/lexer/symbol.js.map +1 -1
  41. package/dist/cjs/lexer/token.d.ts +3 -3
  42. package/dist/cjs/lexer/token.js +63 -64
  43. package/dist/cjs/lexer/token.js.map +1 -1
  44. package/dist/cjs/lexer/types.d.ts +142 -142
  45. package/dist/cjs/lexer/types.js +2 -2
  46. package/dist/cjs/parser/cursor.d.ts +2 -2
  47. package/dist/cjs/parser/cursor.js +12 -13
  48. package/dist/cjs/parser/cursor.js.map +1 -1
  49. package/dist/cjs/parser/index.d.ts +3 -3
  50. package/dist/cjs/parser/index.js +19 -19
  51. package/dist/cjs/parser/tree.d.ts +4 -4
  52. package/dist/cjs/parser/tree.js +245 -246
  53. package/dist/cjs/parser/tree.js.map +1 -1
  54. package/dist/cjs/parser/types.d.ts +33 -33
  55. package/dist/cjs/parser/types.js +2 -2
  56. package/dist/cjs/query/builder.d.ts +144 -144
  57. package/dist/cjs/query/builder.d.ts.map +1 -1
  58. package/dist/cjs/query/builder.js +333 -332
  59. package/dist/cjs/query/builder.js.map +1 -1
  60. package/dist/cjs/query/handler.d.ts +2 -2
  61. package/dist/cjs/query/handler.js +9 -10
  62. package/dist/cjs/query/handler.js.map +1 -1
  63. package/dist/cjs/query/index.d.ts +2 -2
  64. package/dist/cjs/query/index.js +32 -32
  65. package/dist/cjs/query/matchers/abstract-matcher.d.ts +9 -9
  66. package/dist/cjs/query/matchers/abstract-matcher.js +36 -36
  67. package/dist/cjs/query/matchers/abstract-matcher.js.map +1 -1
  68. package/dist/cjs/query/matchers/alt-matcher.d.ts +10 -10
  69. package/dist/cjs/query/matchers/alt-matcher.js +33 -33
  70. package/dist/cjs/query/matchers/alt-matcher.js.map +1 -1
  71. package/dist/cjs/query/matchers/anchor-matcher.d.ts +17 -17
  72. package/dist/cjs/query/matchers/anchor-matcher.js +50 -50
  73. package/dist/cjs/query/matchers/anchor-matcher.js.map +1 -1
  74. package/dist/cjs/query/matchers/comment-matcher.d.ts +10 -10
  75. package/dist/cjs/query/matchers/comment-matcher.js +39 -39
  76. package/dist/cjs/query/matchers/comment-matcher.js.map +1 -1
  77. package/dist/cjs/query/matchers/index.d.ts +6 -6
  78. package/dist/cjs/query/matchers/index.js +22 -22
  79. package/dist/cjs/query/matchers/many-matcher.d.ts +13 -13
  80. package/dist/cjs/query/matchers/many-matcher.js +61 -61
  81. package/dist/cjs/query/matchers/many-matcher.js.map +1 -1
  82. package/dist/cjs/query/matchers/num-matcher.d.ts +8 -8
  83. package/dist/cjs/query/matchers/num-matcher.js +34 -34
  84. package/dist/cjs/query/matchers/num-matcher.js.map +1 -1
  85. package/dist/cjs/query/matchers/op-matcher.d.ts +8 -8
  86. package/dist/cjs/query/matchers/op-matcher.js +34 -34
  87. package/dist/cjs/query/matchers/op-matcher.js.map +1 -1
  88. package/dist/cjs/query/matchers/seq-matcher.d.ts +14 -14
  89. package/dist/cjs/query/matchers/seq-matcher.js +76 -76
  90. package/dist/cjs/query/matchers/seq-matcher.js.map +1 -1
  91. package/dist/cjs/query/matchers/str-matcher.d.ts +38 -38
  92. package/dist/cjs/query/matchers/str-matcher.js +108 -108
  93. package/dist/cjs/query/matchers/str-matcher.js.map +1 -1
  94. package/dist/cjs/query/matchers/sym-matcher.d.ts +8 -8
  95. package/dist/cjs/query/matchers/sym-matcher.js +34 -34
  96. package/dist/cjs/query/matchers/sym-matcher.js.map +1 -1
  97. package/dist/cjs/query/matchers/tree-matcher.d.ts +23 -23
  98. package/dist/cjs/query/matchers/tree-matcher.js +121 -121
  99. package/dist/cjs/query/matchers/tree-matcher.js.map +1 -1
  100. package/dist/cjs/query/options.d.ts +10 -10
  101. package/dist/cjs/query/options.js +148 -149
  102. package/dist/cjs/query/options.js.map +1 -1
  103. package/dist/cjs/query/regex.d.ts +1 -1
  104. package/dist/cjs/query/regex.js +12 -13
  105. package/dist/cjs/query/regex.js.map +1 -1
  106. package/dist/cjs/query/types.d.ts +100 -100
  107. package/dist/cjs/query/types.d.ts.map +1 -1
  108. package/dist/cjs/query/types.js +2 -2
  109. package/dist/cjs/util/clone.d.ts +1 -1
  110. package/dist/cjs/util/clone.js +5 -5
  111. package/dist/cjs/util/regex.d.ts +1 -1
  112. package/dist/cjs/util/regex.js +6 -7
  113. package/dist/cjs/util/regex.js.map +1 -1
  114. package/dist/esm/index.d.ts +4 -4
  115. package/dist/esm/index.js +8 -8
  116. package/dist/esm/lang/groovy.d.ts +6 -6
  117. package/dist/esm/lang/groovy.js +80 -80
  118. package/dist/esm/lang/index.d.ts +20 -20
  119. package/dist/esm/lang/index.js +37 -37
  120. package/dist/esm/lang/python.d.ts +6 -6
  121. package/dist/esm/lang/python.js +70 -70
  122. package/dist/esm/lang/scala.d.ts +6 -6
  123. package/dist/esm/lang/scala.js +68 -68
  124. package/dist/esm/lang/starlark.d.ts +6 -6
  125. package/dist/esm/lang/starlark.js +55 -55
  126. package/dist/esm/lang/types.d.ts +6 -6
  127. package/dist/esm/lang/types.js +1 -1
  128. package/dist/esm/lexer/bracket.d.ts +6 -6
  129. package/dist/esm/lexer/bracket.js +49 -49
  130. package/dist/esm/lexer/bracket.js.map +1 -1
  131. package/dist/esm/lexer/comment.d.ts +3 -3
  132. package/dist/esm/lexer/comment.js +39 -39
  133. package/dist/esm/lexer/comment.js.map +1 -1
  134. package/dist/esm/lexer/index.d.ts +5 -5
  135. package/dist/esm/lexer/index.js +136 -136
  136. package/dist/esm/lexer/index.js.map +1 -1
  137. package/dist/esm/lexer/number.d.ts +2 -2
  138. package/dist/esm/lexer/number.js +14 -14
  139. package/dist/esm/lexer/operator.d.ts +2 -2
  140. package/dist/esm/lexer/operator.js +20 -20
  141. package/dist/esm/lexer/rules.d.ts +4 -4
  142. package/dist/esm/lexer/rules.js +69 -69
  143. package/dist/esm/lexer/rules.js.map +1 -1
  144. package/dist/esm/lexer/string.d.ts +2 -2
  145. package/dist/esm/lexer/string.js +177 -177
  146. package/dist/esm/lexer/string.js.map +1 -1
  147. package/dist/esm/lexer/symbol.d.ts +2 -2
  148. package/dist/esm/lexer/symbol.js +14 -14
  149. package/dist/esm/lexer/token.d.ts +3 -3
  150. package/dist/esm/lexer/token.js +60 -60
  151. package/dist/esm/lexer/token.js.map +1 -1
  152. package/dist/esm/lexer/types.d.ts +142 -142
  153. package/dist/esm/lexer/types.js +1 -1
  154. package/dist/esm/parser/cursor.d.ts +2 -2
  155. package/dist/esm/parser/cursor.js +9 -9
  156. package/dist/esm/parser/index.d.ts +3 -3
  157. package/dist/esm/parser/index.js +3 -3
  158. package/dist/esm/parser/tree.d.ts +4 -4
  159. package/dist/esm/parser/tree.js +241 -241
  160. package/dist/esm/parser/tree.js.map +1 -1
  161. package/dist/esm/parser/types.d.ts +33 -33
  162. package/dist/esm/parser/types.js +1 -1
  163. package/dist/esm/query/builder.d.ts +144 -144
  164. package/dist/esm/query/builder.d.ts.map +1 -1
  165. package/dist/esm/query/builder.js +305 -304
  166. package/dist/esm/query/builder.js.map +1 -1
  167. package/dist/esm/query/handler.d.ts +2 -2
  168. package/dist/esm/query/handler.js +6 -6
  169. package/dist/esm/query/index.d.ts +2 -2
  170. package/dist/esm/query/index.js +2 -2
  171. package/dist/esm/query/matchers/abstract-matcher.d.ts +9 -9
  172. package/dist/esm/query/matchers/abstract-matcher.js +32 -32
  173. package/dist/esm/query/matchers/abstract-matcher.js.map +1 -1
  174. package/dist/esm/query/matchers/alt-matcher.d.ts +10 -10
  175. package/dist/esm/query/matchers/alt-matcher.js +29 -29
  176. package/dist/esm/query/matchers/alt-matcher.js.map +1 -1
  177. package/dist/esm/query/matchers/anchor-matcher.d.ts +17 -17
  178. package/dist/esm/query/matchers/anchor-matcher.js +44 -44
  179. package/dist/esm/query/matchers/anchor-matcher.js.map +1 -1
  180. package/dist/esm/query/matchers/comment-matcher.d.ts +10 -10
  181. package/dist/esm/query/matchers/comment-matcher.js +35 -35
  182. package/dist/esm/query/matchers/comment-matcher.js.map +1 -1
  183. package/dist/esm/query/matchers/index.d.ts +6 -6
  184. package/dist/esm/query/matchers/index.js +6 -6
  185. package/dist/esm/query/matchers/many-matcher.d.ts +13 -13
  186. package/dist/esm/query/matchers/many-matcher.js +57 -57
  187. package/dist/esm/query/matchers/many-matcher.js.map +1 -1
  188. package/dist/esm/query/matchers/num-matcher.d.ts +8 -8
  189. package/dist/esm/query/matchers/num-matcher.js +30 -30
  190. package/dist/esm/query/matchers/num-matcher.js.map +1 -1
  191. package/dist/esm/query/matchers/op-matcher.d.ts +8 -8
  192. package/dist/esm/query/matchers/op-matcher.js +30 -30
  193. package/dist/esm/query/matchers/op-matcher.js.map +1 -1
  194. package/dist/esm/query/matchers/seq-matcher.d.ts +14 -14
  195. package/dist/esm/query/matchers/seq-matcher.js +72 -72
  196. package/dist/esm/query/matchers/seq-matcher.js.map +1 -1
  197. package/dist/esm/query/matchers/str-matcher.d.ts +38 -38
  198. package/dist/esm/query/matchers/str-matcher.js +102 -102
  199. package/dist/esm/query/matchers/str-matcher.js.map +1 -1
  200. package/dist/esm/query/matchers/sym-matcher.d.ts +8 -8
  201. package/dist/esm/query/matchers/sym-matcher.js +30 -30
  202. package/dist/esm/query/matchers/sym-matcher.js.map +1 -1
  203. package/dist/esm/query/matchers/tree-matcher.d.ts +23 -23
  204. package/dist/esm/query/matchers/tree-matcher.js +117 -117
  205. package/dist/esm/query/matchers/tree-matcher.js.map +1 -1
  206. package/dist/esm/query/options.d.ts +10 -10
  207. package/dist/esm/query/options.js +139 -139
  208. package/dist/esm/query/options.js.map +1 -1
  209. package/dist/esm/query/regex.d.ts +1 -1
  210. package/dist/esm/query/regex.js +9 -9
  211. package/dist/esm/query/regex.js.map +1 -1
  212. package/dist/esm/query/types.d.ts +100 -100
  213. package/dist/esm/query/types.d.ts.map +1 -1
  214. package/dist/esm/query/types.js +1 -1
  215. package/dist/esm/util/clone.d.ts +1 -1
  216. package/dist/esm/util/clone.js +1 -1
  217. package/dist/esm/util/regex.d.ts +1 -1
  218. package/dist/esm/util/regex.js +3 -3
  219. package/package.json +42 -46
@@ -1,71 +1,71 @@
1
- /**
2
- * @see https://docs.python.org/3/reference/lexical_analysis.html#operators
3
- */
4
- const operators =
5
- /* prettier-ignore */ [
6
- // Operators
7
- '+', '-', '*', '**', '/', '//', '%', '@',
8
- '<<', '>>', '&', '|', '^', '~', ':=',
9
- '<', '>', '<=', '>=', '==', '!=',
10
- // Delimiters
11
- ',', ':', '.', ';', '@', '=', '->',
12
- '+=', '-=', '*=', '/=', '//=', '%=', '@=',
13
- '&=', '|=', '^=', '>>=', '<<=', '**=',
14
- ];
15
- /**
16
- * @see https://docs.python.org/3/reference/lexical_analysis.html#numeric-literals
17
- */
18
- const bindigit = '[01]';
19
- const octdigit = '[0-7]';
20
- const digit = '[0-9]';
21
- const nonzerodigit = '[1-9]';
22
- const hexdigit = `(?:${digit}|[a-fA-F])`;
23
- const bininteger = `(?:0[bB](?:_?${bindigit})+)`;
24
- const octinteger = `(?:0[oO](?:_?${octdigit})+)`;
25
- const hexinteger = `(?:0[xX](?:_?${hexdigit})+)`;
26
- const decinteger = `(?:${nonzerodigit}(?:_?${digit})*|0+(?:_?0)*)`;
27
- const integer = `(?:${decinteger}|${bininteger}|${octinteger}|${hexinteger})`;
28
- const digitpart = `(?:${digit}(?:_?${digit})*)`;
29
- const fraction = `(?:\\.${digitpart})`;
30
- const exponent = `(?:[eE][-+]?${digitpart})`;
31
- const pointfloat = `(?:${digitpart}?${fraction}|${digitpart}\\.)`;
32
- const exponentfloat = `(?:(?:${digitpart}|${pointfloat})${exponent})`;
33
- const floatnumber = `(?:${pointfloat}|${exponentfloat})`;
34
- const numbers = new RegExp(`(?:${integer}|${floatnumber})`);
35
- export const lexer = {
36
- joinLines: '\\',
37
- comments: [{ type: 'line-comment', startsWith: '#' }],
38
- symbols: /[_a-zA-Z][_a-zA-Z0-9]*/,
39
- numbers,
40
- operators,
41
- brackets: [
42
- { startsWith: '{', endsWith: '}' },
43
- { startsWith: '[', endsWith: ']' },
44
- { startsWith: '(', endsWith: ')' },
45
- ],
46
- strings: [
47
- { startsWith: "'", escapeChar: '\\' },
48
- { startsWith: '"', escapeChar: '\\' },
49
- { startsWith: "'''", escapeChar: '\\' },
50
- { startsWith: '"""', escapeChar: '\\' },
51
- {
52
- startsWith: "f'",
53
- endsWith: "'",
54
- escapeChar: '\\',
55
- templates: [{ type: 'expr', startsWith: '{', endsWith: '}' }],
56
- },
57
- {
58
- startsWith: 'f"',
59
- endsWith: '"',
60
- escapeChar: '\\',
61
- templates: [{ type: 'expr', startsWith: '{', endsWith: '}' }],
62
- },
63
- { startsWith: "r'", endsWith: "'" },
64
- { startsWith: 'r"', endsWith: '"' },
65
- ],
66
- };
67
- export const parser = {
68
- useIndentBlocks: true,
69
- };
70
- export const lang = { lexer, parser };
1
+ /**
2
+ * @see https://docs.python.org/3/reference/lexical_analysis.html#operators
3
+ */
4
+ const operators =
5
+ /* prettier-ignore */ [
6
+ // Operators
7
+ '+', '-', '*', '**', '/', '//', '%', '@',
8
+ '<<', '>>', '&', '|', '^', '~', ':=',
9
+ '<', '>', '<=', '>=', '==', '!=',
10
+ // Delimiters
11
+ ',', ':', '.', ';', '@', '=', '->',
12
+ '+=', '-=', '*=', '/=', '//=', '%=', '@=',
13
+ '&=', '|=', '^=', '>>=', '<<=', '**=',
14
+ ];
15
+ /**
16
+ * @see https://docs.python.org/3/reference/lexical_analysis.html#numeric-literals
17
+ */
18
+ const bindigit = '[01]';
19
+ const octdigit = '[0-7]';
20
+ const digit = '[0-9]';
21
+ const nonzerodigit = '[1-9]';
22
+ const hexdigit = `(?:${digit}|[a-fA-F])`;
23
+ const bininteger = `(?:0[bB](?:_?${bindigit})+)`;
24
+ const octinteger = `(?:0[oO](?:_?${octdigit})+)`;
25
+ const hexinteger = `(?:0[xX](?:_?${hexdigit})+)`;
26
+ const decinteger = `(?:${nonzerodigit}(?:_?${digit})*|0+(?:_?0)*)`;
27
+ const integer = `(?:${decinteger}|${bininteger}|${octinteger}|${hexinteger})`;
28
+ const digitpart = `(?:${digit}(?:_?${digit})*)`;
29
+ const fraction = `(?:\\.${digitpart})`;
30
+ const exponent = `(?:[eE][-+]?${digitpart})`;
31
+ const pointfloat = `(?:${digitpart}?${fraction}|${digitpart}\\.)`;
32
+ const exponentfloat = `(?:(?:${digitpart}|${pointfloat})${exponent})`;
33
+ const floatnumber = `(?:${pointfloat}|${exponentfloat})`;
34
+ const numbers = new RegExp(`(?:${integer}|${floatnumber})`);
35
+ export const lexer = {
36
+ joinLines: '\\',
37
+ comments: [{ type: 'line-comment', startsWith: '#' }],
38
+ symbols: /[_a-zA-Z][_a-zA-Z0-9]*/,
39
+ numbers,
40
+ operators,
41
+ brackets: [
42
+ { startsWith: '{', endsWith: '}' },
43
+ { startsWith: '[', endsWith: ']' },
44
+ { startsWith: '(', endsWith: ')' },
45
+ ],
46
+ strings: [
47
+ { startsWith: "'", escapeChar: '\\' },
48
+ { startsWith: '"', escapeChar: '\\' },
49
+ { startsWith: "'''", escapeChar: '\\' },
50
+ { startsWith: '"""', escapeChar: '\\' },
51
+ {
52
+ startsWith: "f'",
53
+ endsWith: "'",
54
+ escapeChar: '\\',
55
+ templates: [{ type: 'expr', startsWith: '{', endsWith: '}' }],
56
+ },
57
+ {
58
+ startsWith: 'f"',
59
+ endsWith: '"',
60
+ escapeChar: '\\',
61
+ templates: [{ type: 'expr', startsWith: '{', endsWith: '}' }],
62
+ },
63
+ { startsWith: "r'", endsWith: "'" },
64
+ { startsWith: 'r"', endsWith: '"' },
65
+ ],
66
+ };
67
+ export const parser = {
68
+ useIndentBlocks: true,
69
+ };
70
+ export const lang = { lexer, parser };
71
71
  //# sourceMappingURL=python.js.map
@@ -1,7 +1,7 @@
1
- import type { LexerConfig } from '../lexer/types';
2
- import type { ParserConfig } from '../parser/types';
3
- import type { LanguageConfig } from './types';
4
- export declare const lexer: LexerConfig;
5
- export declare const parser: ParserConfig;
6
- export declare const lang: LanguageConfig;
1
+ import type { LexerConfig } from '../lexer/types';
2
+ import type { ParserConfig } from '../parser/types';
3
+ import type { LanguageConfig } from './types';
4
+ export declare const lexer: LexerConfig;
5
+ export declare const parser: ParserConfig;
6
+ export declare const lang: LanguageConfig;
7
7
  //# sourceMappingURL=scala.d.ts.map
@@ -1,69 +1,69 @@
1
- const operators =
2
- /* prettier-ignore */ [
3
- '+', '-', '*', '/', '%', '%%', '%%%', '**',
4
- '++', '--',
5
- '+=', '++=', '-=', '*=', '/=', '%=', '**=',
6
- '==', '!=', '<', '<=', '>', '>=', '===', '!==', '<=>',
7
- '&&', '||', '!',
8
- '&', '|', '^', '~',
9
- '<<', '>>', '>>>',
10
- '?', '?:',
11
- ':=', '=', '?=',
12
- '.', '?.', '.@', '.&', '::', ':::',
13
- '=~', '==~',
14
- '*.', ':',
15
- '..', '..<',
16
- '<>',
17
- '<<=', '>>=', '>>>=', '&=', '^=', '|=', '?=',
18
- '->',
19
- ',', ';',
20
- ];
21
- const octdigit = '[0-7]';
22
- const digit = '[0-9]';
23
- const nonzerodigit = '[1-9]';
24
- const hexdigit = `(?:${digit}|[a-fA-F])`;
25
- const octinteger = `(?:0[oO](?:_?${octdigit})+)`;
26
- const hexinteger = `(?:0[xX](?:_?${hexdigit})+)`;
27
- const decinteger = `(?:${nonzerodigit}(?:_?${digit})*|0+(?:_?0)*)`;
28
- const integer = `(?:${decinteger}|${octinteger}|${hexinteger})`;
29
- const digitpart = `(?:${digit}(?:_?${digit})*)`;
30
- const fraction = `(?:\\.${digitpart})`;
31
- const exponent = `(?:[eE][-+]?${digitpart})`;
32
- const pointfloat = `(?:${digitpart}?${fraction}|${digitpart}\\.)`;
33
- const exponentfloat = `(?:(?:${digitpart}|${pointfloat})${exponent})`;
34
- const floatnumber = `(?:${pointfloat}|${exponentfloat})`;
35
- const numbers = new RegExp(`(?:${integer}|${floatnumber})`);
36
- const templates = [
37
- {
38
- type: 'var',
39
- startsWith: '$',
40
- symbols: /[a-zA-Z_][a-zA-Z0-9_]+/,
41
- },
42
- { type: 'expr', startsWith: '${', endsWith: '}' },
43
- ];
44
- export const lexer = {
45
- joinLines: '\\',
46
- comments: [
47
- { type: 'line-comment', startsWith: '//' },
48
- { type: 'multiline-comment', startsWith: '/*', endsWith: '*/' },
49
- ],
50
- symbols: /[_a-zA-Z][_a-zA-Z0-9]*/,
51
- numbers,
52
- operators,
53
- brackets: [
54
- { startsWith: '{', endsWith: '}' },
55
- { startsWith: '[', endsWith: ']' },
56
- { startsWith: '(', endsWith: ')' },
57
- ],
58
- strings: [
59
- { startsWith: '"', escapeChar: '\\' },
60
- { startsWith: 'raw"', endsWith: '"' },
61
- { startsWith: 's"', templates, endsWith: '"', escapeChar: '\\' },
62
- { startsWith: 'f"', templates, endsWith: '"', escapeChar: '\\' },
63
- ],
64
- };
65
- export const parser = {
66
- useIndentBlocks: false,
67
- };
68
- export const lang = { lexer, parser };
1
+ const operators =
2
+ /* prettier-ignore */ [
3
+ '+', '-', '*', '/', '%', '%%', '%%%', '**',
4
+ '++', '--',
5
+ '+=', '++=', '-=', '*=', '/=', '%=', '**=',
6
+ '==', '!=', '<', '<=', '>', '>=', '===', '!==', '<=>',
7
+ '&&', '||', '!',
8
+ '&', '|', '^', '~',
9
+ '<<', '>>', '>>>',
10
+ '?', '?:',
11
+ ':=', '=', '?=',
12
+ '.', '?.', '.@', '.&', '::', ':::',
13
+ '=~', '==~',
14
+ '*.', ':',
15
+ '..', '..<',
16
+ '<>',
17
+ '<<=', '>>=', '>>>=', '&=', '^=', '|=', '?=',
18
+ '->',
19
+ ',', ';',
20
+ ];
21
+ const octdigit = '[0-7]';
22
+ const digit = '[0-9]';
23
+ const nonzerodigit = '[1-9]';
24
+ const hexdigit = `(?:${digit}|[a-fA-F])`;
25
+ const octinteger = `(?:0[oO](?:_?${octdigit})+)`;
26
+ const hexinteger = `(?:0[xX](?:_?${hexdigit})+)`;
27
+ const decinteger = `(?:${nonzerodigit}(?:_?${digit})*|0+(?:_?0)*)`;
28
+ const integer = `(?:${decinteger}|${octinteger}|${hexinteger})`;
29
+ const digitpart = `(?:${digit}(?:_?${digit})*)`;
30
+ const fraction = `(?:\\.${digitpart})`;
31
+ const exponent = `(?:[eE][-+]?${digitpart})`;
32
+ const pointfloat = `(?:${digitpart}?${fraction}|${digitpart}\\.)`;
33
+ const exponentfloat = `(?:(?:${digitpart}|${pointfloat})${exponent})`;
34
+ const floatnumber = `(?:${pointfloat}|${exponentfloat})`;
35
+ const numbers = new RegExp(`(?:${integer}|${floatnumber})`);
36
+ const templates = [
37
+ {
38
+ type: 'var',
39
+ startsWith: '$',
40
+ symbols: /[a-zA-Z_][a-zA-Z0-9_]+/,
41
+ },
42
+ { type: 'expr', startsWith: '${', endsWith: '}' },
43
+ ];
44
+ export const lexer = {
45
+ joinLines: '\\',
46
+ comments: [
47
+ { type: 'line-comment', startsWith: '//' },
48
+ { type: 'multiline-comment', startsWith: '/*', endsWith: '*/' },
49
+ ],
50
+ symbols: /[_a-zA-Z][_a-zA-Z0-9]*/,
51
+ numbers,
52
+ operators,
53
+ brackets: [
54
+ { startsWith: '{', endsWith: '}' },
55
+ { startsWith: '[', endsWith: ']' },
56
+ { startsWith: '(', endsWith: ')' },
57
+ ],
58
+ strings: [
59
+ { startsWith: '"', escapeChar: '\\' },
60
+ { startsWith: 'raw"', endsWith: '"' },
61
+ { startsWith: 's"', templates, endsWith: '"', escapeChar: '\\' },
62
+ { startsWith: 'f"', templates, endsWith: '"', escapeChar: '\\' },
63
+ ],
64
+ };
65
+ export const parser = {
66
+ useIndentBlocks: false,
67
+ };
68
+ export const lang = { lexer, parser };
69
69
  //# sourceMappingURL=scala.js.map
@@ -1,7 +1,7 @@
1
- import type { LexerConfig } from '../lexer/types';
2
- import type { ParserConfig } from '../parser/types';
3
- import type { LanguageConfig } from './types';
4
- export declare const lexer: LexerConfig;
5
- export declare const parser: ParserConfig;
6
- export declare const lang: LanguageConfig;
1
+ import type { LexerConfig } from '../lexer/types';
2
+ import type { ParserConfig } from '../parser/types';
3
+ import type { LanguageConfig } from './types';
4
+ export declare const lexer: LexerConfig;
5
+ export declare const parser: ParserConfig;
6
+ export declare const lang: LanguageConfig;
7
7
  //# sourceMappingURL=starlark.d.ts.map
@@ -1,56 +1,56 @@
1
- /**
2
- * @see https://github.com/bazelbuild/starlark/blob/master/spec.md#lexical-elements
3
- */
4
- const operators =
5
- /* prettier-ignore */ [
6
- '+', '-', '*', '//', '%', '**',
7
- '~', '&', '|', '^', '<<', '>>',
8
- '.', ',', '=', ';', ':',
9
- '<', '>', '>=', '<=', '==', '!=',
10
- '+=', '-=', '*=', '//=', '%=',
11
- '&=', '|=', '^=', '<<=', '>>=',
12
- ];
13
- const octdigit = '[0-7]';
14
- const digit = '[0-9]';
15
- const nonzerodigit = '[1-9]';
16
- const hexdigit = `(?:${digit}|[a-fA-F])`;
17
- const octinteger = `(?:0[oO](?:_?${octdigit})+)`;
18
- const hexinteger = `(?:0[xX](?:_?${hexdigit})+)`;
19
- const decinteger = `(?:${nonzerodigit}(?:_?${digit})*|0+(?:_?0)*)`;
20
- const integer = `(?:${decinteger}|${octinteger}|${hexinteger})`;
21
- const digitpart = `(?:${digit}(?:_?${digit})*)`;
22
- const fraction = `(?:\\.${digitpart})`;
23
- const exponent = `(?:[eE][-+]?${digitpart})`;
24
- const pointfloat = `(?:${digitpart}?${fraction}|${digitpart}\\.)`;
25
- const exponentfloat = `(?:(?:${digitpart}|${pointfloat})${exponent})`;
26
- const floatnumber = `(?:${pointfloat}|${exponentfloat})`;
27
- const numbers = new RegExp(`(?:${integer}|${floatnumber})`);
28
- export const lexer = {
29
- joinLines: '\\',
30
- comments: [{ type: 'line-comment', startsWith: '#' }],
31
- symbols: /[_a-zA-Z][_a-zA-Z0-9]*/,
32
- numbers,
33
- operators,
34
- brackets: [
35
- { startsWith: '{', endsWith: '}' },
36
- { startsWith: '[', endsWith: ']' },
37
- { startsWith: '(', endsWith: ')' },
38
- ],
39
- strings: [
40
- { startsWith: "'", escapeChar: '\\' },
41
- { startsWith: '"', escapeChar: '\\' },
42
- { startsWith: "'''", escapeChar: '\\' },
43
- { startsWith: '"""', escapeChar: '\\' },
44
- { startsWith: "r'", endsWith: "'" },
45
- { startsWith: 'r"', endsWith: '"' },
46
- { startsWith: "rb'", endsWith: "'" },
47
- { startsWith: 'rb"', endsWith: '"' },
48
- { startsWith: "br'", endsWith: "'" },
49
- { startsWith: 'br"', endsWith: '"' },
50
- ],
51
- };
52
- export const parser = {
53
- useIndentBlocks: true,
54
- };
55
- export const lang = { lexer, parser };
1
+ /**
2
+ * @see https://github.com/bazelbuild/starlark/blob/master/spec.md#lexical-elements
3
+ */
4
+ const operators =
5
+ /* prettier-ignore */ [
6
+ '+', '-', '*', '//', '%', '**',
7
+ '~', '&', '|', '^', '<<', '>>',
8
+ '.', ',', '=', ';', ':',
9
+ '<', '>', '>=', '<=', '==', '!=',
10
+ '+=', '-=', '*=', '//=', '%=',
11
+ '&=', '|=', '^=', '<<=', '>>=',
12
+ ];
13
+ const octdigit = '[0-7]';
14
+ const digit = '[0-9]';
15
+ const nonzerodigit = '[1-9]';
16
+ const hexdigit = `(?:${digit}|[a-fA-F])`;
17
+ const octinteger = `(?:0[oO](?:_?${octdigit})+)`;
18
+ const hexinteger = `(?:0[xX](?:_?${hexdigit})+)`;
19
+ const decinteger = `(?:${nonzerodigit}(?:_?${digit})*|0+(?:_?0)*)`;
20
+ const integer = `(?:${decinteger}|${octinteger}|${hexinteger})`;
21
+ const digitpart = `(?:${digit}(?:_?${digit})*)`;
22
+ const fraction = `(?:\\.${digitpart})`;
23
+ const exponent = `(?:[eE][-+]?${digitpart})`;
24
+ const pointfloat = `(?:${digitpart}?${fraction}|${digitpart}\\.)`;
25
+ const exponentfloat = `(?:(?:${digitpart}|${pointfloat})${exponent})`;
26
+ const floatnumber = `(?:${pointfloat}|${exponentfloat})`;
27
+ const numbers = new RegExp(`(?:${integer}|${floatnumber})`);
28
+ export const lexer = {
29
+ joinLines: '\\',
30
+ comments: [{ type: 'line-comment', startsWith: '#' }],
31
+ symbols: /[_a-zA-Z][_a-zA-Z0-9]*/,
32
+ numbers,
33
+ operators,
34
+ brackets: [
35
+ { startsWith: '{', endsWith: '}' },
36
+ { startsWith: '[', endsWith: ']' },
37
+ { startsWith: '(', endsWith: ')' },
38
+ ],
39
+ strings: [
40
+ { startsWith: "'", escapeChar: '\\' },
41
+ { startsWith: '"', escapeChar: '\\' },
42
+ { startsWith: "'''", escapeChar: '\\' },
43
+ { startsWith: '"""', escapeChar: '\\' },
44
+ { startsWith: "r'", endsWith: "'" },
45
+ { startsWith: 'r"', endsWith: '"' },
46
+ { startsWith: "rb'", endsWith: "'" },
47
+ { startsWith: 'rb"', endsWith: '"' },
48
+ { startsWith: "br'", endsWith: "'" },
49
+ { startsWith: 'br"', endsWith: '"' },
50
+ ],
51
+ };
52
+ export const parser = {
53
+ useIndentBlocks: true,
54
+ };
55
+ export const lang = { lexer, parser };
56
56
  //# sourceMappingURL=starlark.js.map
@@ -1,7 +1,7 @@
1
- import type { LexerConfig } from '../lexer/types';
2
- import type { ParserConfig } from '../parser/types';
3
- export interface LanguageConfig {
4
- lexer: LexerConfig;
5
- parser: ParserConfig;
6
- }
1
+ import type { LexerConfig } from '../lexer/types';
2
+ import type { ParserConfig } from '../parser/types';
3
+ export interface LanguageConfig {
4
+ lexer: LexerConfig;
5
+ parser: ParserConfig;
6
+ }
7
7
  //# sourceMappingURL=types.d.ts.map
@@ -1,2 +1,2 @@
1
- export {};
1
+ export {};
2
2
  //# sourceMappingURL=types.js.map
@@ -1,7 +1,7 @@
1
- import type { BracketOption, StatesMap } from './types';
2
- export declare function isBracketKey(key: string): boolean;
3
- export declare function isLeftKey(key: string): boolean;
4
- export declare function isRightKey(key: string): boolean;
5
- export declare function getCounterpartBracketKey(rightKey: string): string | undefined;
6
- export declare function configBrackets(states: StatesMap, opts: BracketOption[]): StatesMap;
1
+ import type { BracketOption, StatesMap } from './types';
2
+ export declare function isBracketKey(key: string): boolean;
3
+ export declare function isLeftKey(key: string): boolean;
4
+ export declare function isRightKey(key: string): boolean;
5
+ export declare function getCounterpartBracketKey(rightKey: string): string | undefined;
6
+ export declare function configBrackets(states: StatesMap, opts: BracketOption[]): StatesMap;
7
7
  //# sourceMappingURL=bracket.d.ts.map
@@ -1,50 +1,50 @@
1
- export function isBracketKey(key) {
2
- return key.startsWith('bracket$');
3
- }
4
- export function isLeftKey(key) {
5
- return key.endsWith('$left');
6
- }
7
- export function isRightKey(key) {
8
- return key.endsWith('$right');
9
- }
10
- export function getCounterpartBracketKey(rightKey) {
11
- const [tokenName, idx, side] = rightKey.split('$');
12
- const sides = new Set(['left', 'right']);
13
- let result;
14
- if (tokenName === 'bracket' && typeof side === 'string' && sides.has(side)) {
15
- sides.delete(side);
16
- const [counterpart] = [...sides];
17
- result = [tokenName, idx, counterpart].join('$');
18
- }
19
- return result;
20
- }
21
- export function configBrackets(states, opts) {
22
- const bracketDefs = {};
23
- opts.forEach((option, idx) => {
24
- const tokenKey = `bracket$${idx}`;
25
- const leftTokenKey = `${tokenKey}$left`;
26
- const leftTokenRule = {
27
- t: 'string',
28
- type: leftTokenKey,
29
- match: option.startsWith,
30
- chunk: option.startsWith,
31
- };
32
- const rightTokenKey = `${tokenKey}$right`;
33
- const rightTokenRule = {
34
- t: 'string',
35
- type: rightTokenKey,
36
- match: option.endsWith,
37
- chunk: option.endsWith,
38
- };
39
- bracketDefs[leftTokenKey] = leftTokenRule;
40
- bracketDefs[rightTokenKey] = rightTokenRule;
41
- });
42
- return {
43
- ...states,
44
- $: {
45
- ...states.$,
46
- ...bracketDefs,
47
- },
48
- };
49
- }
1
+ export function isBracketKey(key) {
2
+ return key.startsWith('bracket$');
3
+ }
4
+ export function isLeftKey(key) {
5
+ return key.endsWith('$left');
6
+ }
7
+ export function isRightKey(key) {
8
+ return key.endsWith('$right');
9
+ }
10
+ export function getCounterpartBracketKey(rightKey) {
11
+ const [tokenName, idx, side] = rightKey.split('$');
12
+ const sides = new Set(['left', 'right']);
13
+ let result;
14
+ if (tokenName === 'bracket' && typeof side === 'string' && sides.has(side)) {
15
+ sides.delete(side);
16
+ const [counterpart] = [...sides];
17
+ result = [tokenName, idx, counterpart].join('$');
18
+ }
19
+ return result;
20
+ }
21
+ export function configBrackets(states, opts) {
22
+ const bracketDefs = {};
23
+ opts.forEach((option, idx) => {
24
+ const tokenKey = `bracket$${idx}`;
25
+ const leftTokenKey = `${tokenKey}$left`;
26
+ const leftTokenRule = {
27
+ t: 'string',
28
+ type: leftTokenKey,
29
+ match: option.startsWith,
30
+ chunk: option.startsWith,
31
+ };
32
+ const rightTokenKey = `${tokenKey}$right`;
33
+ const rightTokenRule = {
34
+ t: 'string',
35
+ type: rightTokenKey,
36
+ match: option.endsWith,
37
+ chunk: option.endsWith,
38
+ };
39
+ bracketDefs[leftTokenKey] = leftTokenRule;
40
+ bracketDefs[rightTokenKey] = rightTokenRule;
41
+ });
42
+ return {
43
+ ...states,
44
+ $: {
45
+ ...states.$,
46
+ ...bracketDefs,
47
+ },
48
+ };
49
+ }
50
50
  //# sourceMappingURL=bracket.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"bracket.js","sourceRoot":"","sources":["../../../lib/lexer/bracket.ts"],"names":[],"mappings":"AAOA,MAAM,UAAU,YAAY,CAAC,GAAW;IACtC,OAAO,GAAG,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;AACpC,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,GAAW;IACnC,OAAO,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AAC/B,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,GAAW;IACpC,OAAO,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,QAAgB;IACvD,MAAM,CAAC,SAAS,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,QAAQ,C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IACxC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE;QAC3B,MAAM,QAAQ,GAAG,WAAW,GAAG,EAAE,CAAC;QAElC,MAAM,YAAY,GAAG,GAAG,QAAQ,OAAO,CAAC;QACxC,MAAM,aAAa,GAAe;YAChC,CAAC,EAAE,QAAQ;YACX,IAAI,EAAE,YAAY;YAClB,KAAK,EAAE,MAAM,CAAC,UAAU;YACxB,KAAK,EAAE,MAAM,CAAC,UAAU;SACzB,CAAC;QAEF,MAAM,aAAa,GAAG,GAAG,QAAQ,QAAQ,CAAC;QAC1C,MAAM,cAAc,GAAe;YACjC,CAAC,EAAE,QAAQ;YACX,IAAI,EAAE,aAAa;YACnB,KAAK,EAAE,MAAM,CAAC,QAAQ;YACtB,KAAK,EAAE,MAAM,CAAC,QAAQ;SACvB,CAAC;QAEF,WAAW,CAAC,YAAY,CAAC,GAAG,aAAa,CAAC;QAC1C,WAAW,CAAC,aAAa,CAAC,GAAG,cAAc,CAAC;IAC9C,CAAC,CAAC,CAAC;IAEH,OAAO;QACL,GAAG,MAAM;QACT,CAAC,EAAE;YACD,GAAG,MAAM,CAAC,CAAC;YACX,GAAG,WAAW;SACf;KACF,CAAC;AACJ,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { CommentOption, StatesMap } from './types';
2
- export declare function esc(input: string): string;
3
- export declare function configComments(states: StatesMap, opts: CommentOption[]): StatesMap;
1
+ import type { CommentOption, StatesMap } from './types';
2
+ export declare function esc(input: string): string;
3
+ export declare function configComments(states: StatesMap, opts: CommentOption[]): StatesMap;
4
4
  //# sourceMappingURL=comment.d.ts.map