@willbooster/web-tree-sitter 17.0.1 → 17.1.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/dsl.d.ts +19 -0
- package/package.json +1 -1
package/dsl.d.ts
CHANGED
|
@@ -157,6 +157,24 @@ export interface Grammar<
|
|
|
157
157
|
*/
|
|
158
158
|
inline?: ($: GrammarSymbols<RuleName | BaseGrammarRuleName>, previous: SymbolRule<string>[]) => SymbolRule<string>[];
|
|
159
159
|
|
|
160
|
+
/**
|
|
161
|
+
* External tokens that the scanner returns only where no other token of the
|
|
162
|
+
* grammar can start, such as reserved words that the scanner reads, and
|
|
163
|
+
* whose validity the scanner ignores when scanning other tokens. Parse
|
|
164
|
+
* states that differ only in which of these tokens they accept may be
|
|
165
|
+
* merged, so the scanner may see one of them as valid in a state that does
|
|
166
|
+
* not accept it. That leaves the trees of valid input unchanged only if
|
|
167
|
+
* every listed token meets both conditions; trees of invalid input may
|
|
168
|
+
* change, because error recovery sees the merged states.
|
|
169
|
+
*
|
|
170
|
+
* @param $ grammar rules
|
|
171
|
+
* @param previous array of mergeable externals from the base grammar
|
|
172
|
+
*/
|
|
173
|
+
mergeableExternals?: (
|
|
174
|
+
$: GrammarSymbols<RuleName | BaseGrammarRuleName>,
|
|
175
|
+
previous: SymbolRule<string>[],
|
|
176
|
+
) => SymbolRule<string>[];
|
|
177
|
+
|
|
160
178
|
/**
|
|
161
179
|
* A list of hidden rule names that should be considered supertypes in the
|
|
162
180
|
* generated node types file.
|
|
@@ -210,6 +228,7 @@ export type GrammarSchema<RuleName extends string> = {
|
|
|
210
228
|
extras: Rule[];
|
|
211
229
|
inline: string[];
|
|
212
230
|
supertypes: string[];
|
|
231
|
+
mergeable_externals?: string[];
|
|
213
232
|
word: string | undefined;
|
|
214
233
|
reserved: Record<string, Rule[]>;
|
|
215
234
|
};
|