@traqula/core 0.0.1-alpha.10
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/LICENSE.txt +22 -0
- package/README.md +137 -0
- package/lib/CoreFactory.d.ts +39 -0
- package/lib/CoreFactory.js +135 -0
- package/lib/CoreFactory.js.map +1 -0
- package/lib/Transformer.d.ts +26 -0
- package/lib/Transformer.js +57 -0
- package/lib/Transformer.js.map +1 -0
- package/lib/generator-builder/builderTypes.d.ts +20 -0
- package/lib/generator-builder/builderTypes.js +2 -0
- package/lib/generator-builder/builderTypes.js.map +1 -0
- package/lib/generator-builder/dynamicGenerator.d.ts +22 -0
- package/lib/generator-builder/dynamicGenerator.js +115 -0
- package/lib/generator-builder/dynamicGenerator.js.map +1 -0
- package/lib/generator-builder/generatorBuilder.d.ts +60 -0
- package/lib/generator-builder/generatorBuilder.js +104 -0
- package/lib/generator-builder/generatorBuilder.js.map +1 -0
- package/lib/generator-builder/generatorTypes.d.ts +36 -0
- package/lib/generator-builder/generatorTypes.js +2 -0
- package/lib/generator-builder/generatorTypes.js.map +1 -0
- package/lib/index.cjs +10121 -0
- package/lib/index.d.ts +13 -0
- package/lib/index.js +19 -0
- package/lib/index.js.map +1 -0
- package/lib/indirection-builder/IndirBuilder.d.ts +43 -0
- package/lib/indirection-builder/IndirBuilder.js +60 -0
- package/lib/indirection-builder/IndirBuilder.js.map +1 -0
- package/lib/indirection-builder/dynamicIndirected.d.ts +9 -0
- package/lib/indirection-builder/dynamicIndirected.js +28 -0
- package/lib/indirection-builder/dynamicIndirected.js.map +1 -0
- package/lib/indirection-builder/helpers.d.ts +24 -0
- package/lib/indirection-builder/helpers.js +11 -0
- package/lib/indirection-builder/helpers.js.map +1 -0
- package/lib/lexer-builder/LexerBuilder.d.ts +23 -0
- package/lib/lexer-builder/LexerBuilder.js +96 -0
- package/lib/lexer-builder/LexerBuilder.js.map +1 -0
- package/lib/nodeTypings.d.ts +53 -0
- package/lib/nodeTypings.js +2 -0
- package/lib/nodeTypings.js.map +1 -0
- package/lib/parser-builder/builderTypes.d.ts +26 -0
- package/lib/parser-builder/builderTypes.js +2 -0
- package/lib/parser-builder/builderTypes.js.map +1 -0
- package/lib/parser-builder/dynamicParser.d.ts +9 -0
- package/lib/parser-builder/dynamicParser.js +113 -0
- package/lib/parser-builder/dynamicParser.js.map +1 -0
- package/lib/parser-builder/parserBuilder.d.ts +74 -0
- package/lib/parser-builder/parserBuilder.js +171 -0
- package/lib/parser-builder/parserBuilder.js.map +1 -0
- package/lib/parser-builder/ruleDefTypes.d.ts +347 -0
- package/lib/parser-builder/ruleDefTypes.js +2 -0
- package/lib/parser-builder/ruleDefTypes.js.map +1 -0
- package/lib/utils.d.ts +17 -0
- package/lib/utils.js +8 -0
- package/lib/utils.js.map +1 -0
- package/package.json +47 -0
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
import type { AtLeastOneSepMethodOpts, DSLMethodOpts, DSLMethodOptsWithErr, GrammarAction, IOrAlt, ManySepMethodOpts, OrMethodOpts } from '@chevrotain/types';
|
|
2
|
+
import type { ConsumeMethodOpts, IToken, TokenType } from 'chevrotain';
|
|
3
|
+
/**
|
|
4
|
+
* Get the return-type of a RuleDef
|
|
5
|
+
*/
|
|
6
|
+
export type RuleDefReturn<T extends ParserRule> = T extends ParserRule<any, string, infer Ret> ? Ret : never;
|
|
7
|
+
/**
|
|
8
|
+
* Type used to declare grammar rules.
|
|
9
|
+
*/
|
|
10
|
+
export type ParserRule<
|
|
11
|
+
/**
|
|
12
|
+
* Context object available in rule implementation.
|
|
13
|
+
*/
|
|
14
|
+
Context = any,
|
|
15
|
+
/**
|
|
16
|
+
* Name of grammar rule, should be a strict subtype of string like 'myGrammarRule'.
|
|
17
|
+
*/
|
|
18
|
+
NameType extends string = string,
|
|
19
|
+
/**
|
|
20
|
+
* Type that will be returned after a correct parse of this rule.
|
|
21
|
+
* This type will be the return type of calling SUBRULE with this grammar rule.
|
|
22
|
+
*/
|
|
23
|
+
ReturnType = unknown,
|
|
24
|
+
/**
|
|
25
|
+
* Function arguments that can be given to convey the state of the current parse operation.
|
|
26
|
+
*/
|
|
27
|
+
ParamType = any> = {
|
|
28
|
+
name: NameType;
|
|
29
|
+
impl: (def: ImplArgs) => (context: Context, params: ParamType) => ReturnType;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Type expected by grammar rules in the main `impl` function.
|
|
33
|
+
*/
|
|
34
|
+
export interface ImplArgs extends CstDef {
|
|
35
|
+
cache: WeakMap<ParserRule, unknown>;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Type definition used by {@link CstDef.SUBRULE} and family.
|
|
39
|
+
*/
|
|
40
|
+
type SubRuleFunc = <T extends string, U = unknown, ARGS = any>(cstDef: ParserRule<any, T, U, ARGS>, argument: ARGS) => U;
|
|
41
|
+
/**
|
|
42
|
+
* Type definition used by {@link CstDef.BACKTRACK}.
|
|
43
|
+
*/
|
|
44
|
+
type BacktrackFunc = <T extends string, U = unknown, ARGS = any>(cstDef: ParserRule<any, T, U, ARGS>, argument: ARGS) => () => boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Mainly a repetition of the functions exposed by the {@link EmbeddedActionsParser},
|
|
47
|
+
* with some small adjustments that allow for the API changes made by traqula.
|
|
48
|
+
* Specifically changes are made to the {@link CstDef.SUBRULE} (and family) interface,
|
|
49
|
+
* and to the {@link CstDef.BACKTRACK} interface.
|
|
50
|
+
*/
|
|
51
|
+
export interface CstDef {
|
|
52
|
+
/**
|
|
53
|
+
*
|
|
54
|
+
* A Parsing DSL method use to consume a single Token.
|
|
55
|
+
* In EBNF terms this is equivalent to a Terminal.
|
|
56
|
+
*
|
|
57
|
+
* A Token will be consumed, IFF the next token in the token vector matches `tokType`.
|
|
58
|
+
* otherwise the parser may attempt to perform error recovery (if enabled).
|
|
59
|
+
*
|
|
60
|
+
* The index in the method name indicates the unique occurrence of a terminal consumption
|
|
61
|
+
* inside a the top level rule. What this means is that if a terminal appears
|
|
62
|
+
* more than once in a single rule, each appearance must have a **different** index.
|
|
63
|
+
*
|
|
64
|
+
* For example:
|
|
65
|
+
* ```
|
|
66
|
+
* this.RULE("qualifiedName", () => {
|
|
67
|
+
* this.CONSUME1(Identifier);
|
|
68
|
+
* this.MANY(() => {
|
|
69
|
+
* this.CONSUME1(Dot);
|
|
70
|
+
* // here we use CONSUME2 because the terminal
|
|
71
|
+
* // 'Identifier' has already appeared previously in the
|
|
72
|
+
* // the rule 'parseQualifiedName'
|
|
73
|
+
* this.CONSUME2(Identifier);
|
|
74
|
+
* });
|
|
75
|
+
* })
|
|
76
|
+
* ```
|
|
77
|
+
*
|
|
78
|
+
* - See more details on the [unique suffixes requirement](http://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES).
|
|
79
|
+
*
|
|
80
|
+
* @param tokType - The Type of the token to be consumed.
|
|
81
|
+
* @param options - optional properties to modify the behavior of CONSUME.
|
|
82
|
+
*/
|
|
83
|
+
CONSUME: (tokType: TokenType, options?: ConsumeMethodOpts) => IToken;
|
|
84
|
+
CONSUME1: (tokType: TokenType, options?: ConsumeMethodOpts) => IToken;
|
|
85
|
+
CONSUME2: (tokType: TokenType, options?: ConsumeMethodOpts) => IToken;
|
|
86
|
+
CONSUME3: (tokType: TokenType, options?: ConsumeMethodOpts) => IToken;
|
|
87
|
+
CONSUME4: (tokType: TokenType, options?: ConsumeMethodOpts) => IToken;
|
|
88
|
+
CONSUME5: (tokType: TokenType, options?: ConsumeMethodOpts) => IToken;
|
|
89
|
+
CONSUME6: (tokType: TokenType, options?: ConsumeMethodOpts) => IToken;
|
|
90
|
+
CONSUME7: (tokType: TokenType, options?: ConsumeMethodOpts) => IToken;
|
|
91
|
+
CONSUME8: (tokType: TokenType, options?: ConsumeMethodOpts) => IToken;
|
|
92
|
+
CONSUME9: (tokType: TokenType, options?: ConsumeMethodOpts) => IToken;
|
|
93
|
+
/**
|
|
94
|
+
* Parsing DSL Method that Indicates an Optional production.
|
|
95
|
+
* in EBNF notation this is equivalent to: "[...]".
|
|
96
|
+
*
|
|
97
|
+
* Note that there are two syntax forms:
|
|
98
|
+
* - Passing the grammar action directly:
|
|
99
|
+
* ```
|
|
100
|
+
* this.OPTION(() => {
|
|
101
|
+
* this.CONSUME(Digit)}
|
|
102
|
+
* );
|
|
103
|
+
* ```
|
|
104
|
+
*
|
|
105
|
+
* - using an "options" object:
|
|
106
|
+
* ```
|
|
107
|
+
* this.OPTION({
|
|
108
|
+
* GATE:predicateFunc,
|
|
109
|
+
* DEF: () => {
|
|
110
|
+
* this.CONSUME(Digit)
|
|
111
|
+
* }});
|
|
112
|
+
* ```
|
|
113
|
+
*
|
|
114
|
+
* The optional 'GATE' property in "options" object form can be used to add constraints
|
|
115
|
+
* to invoking the grammar action.
|
|
116
|
+
*
|
|
117
|
+
* As in CONSUME the index in the method name indicates the occurrence
|
|
118
|
+
* of the optional production in it's top rule.
|
|
119
|
+
*
|
|
120
|
+
* @param actionORMethodDef - The grammar action to optionally invoke once
|
|
121
|
+
* or an "OPTIONS" object describing the grammar action and optional properties.
|
|
122
|
+
*
|
|
123
|
+
* @returns The `GrammarAction` return value (OUT) if the optional syntax is encountered
|
|
124
|
+
* or `undefined` if not.
|
|
125
|
+
*/
|
|
126
|
+
OPTION: <OUT>(actionORMethodDef: GrammarAction<OUT> | DSLMethodOpts<OUT>) => OUT | undefined;
|
|
127
|
+
OPTION1: <OUT>(actionORMethodDef: GrammarAction<OUT> | DSLMethodOpts<OUT>) => OUT | undefined;
|
|
128
|
+
OPTION2: <OUT>(actionORMethodDef: GrammarAction<OUT> | DSLMethodOpts<OUT>) => OUT | undefined;
|
|
129
|
+
OPTION3: <OUT>(actionORMethodDef: GrammarAction<OUT> | DSLMethodOpts<OUT>) => OUT | undefined;
|
|
130
|
+
OPTION4: <OUT>(actionORMethodDef: GrammarAction<OUT> | DSLMethodOpts<OUT>) => OUT | undefined;
|
|
131
|
+
OPTION5: <OUT>(actionORMethodDef: GrammarAction<OUT> | DSLMethodOpts<OUT>) => OUT | undefined;
|
|
132
|
+
OPTION6: <OUT>(actionORMethodDef: GrammarAction<OUT> | DSLMethodOpts<OUT>) => OUT | undefined;
|
|
133
|
+
OPTION7: <OUT>(actionORMethodDef: GrammarAction<OUT> | DSLMethodOpts<OUT>) => OUT | undefined;
|
|
134
|
+
OPTION8: <OUT>(actionORMethodDef: GrammarAction<OUT> | DSLMethodOpts<OUT>) => OUT | undefined;
|
|
135
|
+
OPTION9: <OUT>(actionORMethodDef: GrammarAction<OUT> | DSLMethodOpts<OUT>) => OUT | undefined;
|
|
136
|
+
/**
|
|
137
|
+
* Parsing DSL method that indicates a choice between a set of alternatives must be made.
|
|
138
|
+
* This is equivalent to an EBNF alternation (A | B | C | D ...), except
|
|
139
|
+
* that the alternatives are ordered like in a PEG grammar.
|
|
140
|
+
* This means that the **first** matching alternative is always chosen.
|
|
141
|
+
*
|
|
142
|
+
* There are several forms for the inner alternatives array:
|
|
143
|
+
*
|
|
144
|
+
* - Passing alternatives array directly:
|
|
145
|
+
* ```
|
|
146
|
+
* this.OR([
|
|
147
|
+
* { ALT:() => { this.CONSUME(One) }},
|
|
148
|
+
* { ALT:() => { this.CONSUME(Two) }},
|
|
149
|
+
* { ALT:() => { this.CONSUME(Three) }}
|
|
150
|
+
* ])
|
|
151
|
+
* ```
|
|
152
|
+
*
|
|
153
|
+
* - Passing alternative array directly with predicates (GATE):
|
|
154
|
+
* ```
|
|
155
|
+
* this.OR([
|
|
156
|
+
* { GATE: predicateFunc1, ALT:() => { this.CONSUME(One) }},
|
|
157
|
+
* { GATE: predicateFuncX, ALT:() => { this.CONSUME(Two) }},
|
|
158
|
+
* { GATE: predicateFuncX, ALT:() => { this.CONSUME(Three) }}
|
|
159
|
+
* ])
|
|
160
|
+
* ```
|
|
161
|
+
*
|
|
162
|
+
* - These syntax forms can also be mixed:
|
|
163
|
+
* ```
|
|
164
|
+
* this.OR([
|
|
165
|
+
* {
|
|
166
|
+
* GATE: predicateFunc1,
|
|
167
|
+
* ALT:() => { this.CONSUME(One) }
|
|
168
|
+
* },
|
|
169
|
+
* { ALT:() => { this.CONSUME(Two) }},
|
|
170
|
+
* { ALT:() => { this.CONSUME(Three) }}
|
|
171
|
+
* ])
|
|
172
|
+
* ```
|
|
173
|
+
*
|
|
174
|
+
* - Additionally an "options" object may be used:
|
|
175
|
+
* ```
|
|
176
|
+
* this.OR({
|
|
177
|
+
* DEF:[
|
|
178
|
+
* { ALT:() => { this.CONSUME(One) }},
|
|
179
|
+
* { ALT:() => { this.CONSUME(Two) }},
|
|
180
|
+
* { ALT:() => { this.CONSUME(Three) }}
|
|
181
|
+
* ],
|
|
182
|
+
* // OPTIONAL property
|
|
183
|
+
* ERR_MSG: "A Number"
|
|
184
|
+
* })
|
|
185
|
+
* ```
|
|
186
|
+
*
|
|
187
|
+
* The 'predicateFuncX' in the long form can be used to add constraints to choosing the alternative.
|
|
188
|
+
*
|
|
189
|
+
* As in CONSUME the index in the method name indicates the occurrence
|
|
190
|
+
* of the alternation production in it's top rule.
|
|
191
|
+
*
|
|
192
|
+
* @param altsOrOpts - A set of alternatives or an "OPTIONS" object describing the alternatives
|
|
193
|
+
* and optional properties.
|
|
194
|
+
*
|
|
195
|
+
* @returns The result of invoking the chosen alternative.
|
|
196
|
+
*/
|
|
197
|
+
OR: <T>(altsOrOpts: IOrAlt<T>[] | OrMethodOpts<T>) => T;
|
|
198
|
+
OR1: <T>(altsOrOpts: IOrAlt<T>[] | OrMethodOpts<T>) => T;
|
|
199
|
+
OR2: <T>(altsOrOpts: IOrAlt<T>[] | OrMethodOpts<T>) => T;
|
|
200
|
+
OR3: <T>(altsOrOpts: IOrAlt<T>[] | OrMethodOpts<T>) => T;
|
|
201
|
+
OR4: <T>(altsOrOpts: IOrAlt<T>[] | OrMethodOpts<T>) => T;
|
|
202
|
+
OR5: <T>(altsOrOpts: IOrAlt<T>[] | OrMethodOpts<T>) => T;
|
|
203
|
+
OR6: <T>(altsOrOpts: IOrAlt<T>[] | OrMethodOpts<T>) => T;
|
|
204
|
+
OR7: <T>(altsOrOpts: IOrAlt<T>[] | OrMethodOpts<T>) => T;
|
|
205
|
+
OR8: <T>(altsOrOpts: IOrAlt<T>[] | OrMethodOpts<T>) => T;
|
|
206
|
+
OR9: <T>(altsOrOpts: IOrAlt<T>[] | OrMethodOpts<T>) => T;
|
|
207
|
+
/**
|
|
208
|
+
* Parsing DSL method, that indicates a repetition of zero or more.
|
|
209
|
+
* This is equivalent to EBNF repetition \{...\}.
|
|
210
|
+
*
|
|
211
|
+
* Note that there are two syntax forms:
|
|
212
|
+
* - Passing the grammar action directly:
|
|
213
|
+
* ```
|
|
214
|
+
* this.MANY(() => {
|
|
215
|
+
* this.CONSUME(Comma)
|
|
216
|
+
* this.CONSUME(Digit)
|
|
217
|
+
* })
|
|
218
|
+
* ```
|
|
219
|
+
*
|
|
220
|
+
* - using an "options" object:
|
|
221
|
+
* ```
|
|
222
|
+
* this.MANY({
|
|
223
|
+
* GATE: predicateFunc,
|
|
224
|
+
* DEF: () => {
|
|
225
|
+
* this.CONSUME(Comma)
|
|
226
|
+
* this.CONSUME(Digit)
|
|
227
|
+
* }
|
|
228
|
+
* });
|
|
229
|
+
* ```
|
|
230
|
+
*
|
|
231
|
+
* The optional 'GATE' property in "options" object form can be used to add constraints
|
|
232
|
+
* to invoking the grammar action.
|
|
233
|
+
*
|
|
234
|
+
* As in CONSUME the index in the method name indicates the occurrence
|
|
235
|
+
* of the repetition production in it's top rule.
|
|
236
|
+
*
|
|
237
|
+
* @param actionORMethodDef - The grammar action to optionally invoke multiple times
|
|
238
|
+
* or an "OPTIONS" object describing the grammar action and optional properties.
|
|
239
|
+
*
|
|
240
|
+
*/
|
|
241
|
+
MANY: (actionORMethodDef: GrammarAction<any> | DSLMethodOpts<any>) => void;
|
|
242
|
+
MANY1: (actionORMethodDef: GrammarAction<any> | DSLMethodOpts<any>) => void;
|
|
243
|
+
MANY2: (actionORMethodDef: GrammarAction<any> | DSLMethodOpts<any>) => void;
|
|
244
|
+
MANY3: (actionORMethodDef: GrammarAction<any> | DSLMethodOpts<any>) => void;
|
|
245
|
+
MANY4: (actionORMethodDef: GrammarAction<any> | DSLMethodOpts<any>) => void;
|
|
246
|
+
MANY5: (actionORMethodDef: GrammarAction<any> | DSLMethodOpts<any>) => void;
|
|
247
|
+
MANY6: (actionORMethodDef: GrammarAction<any> | DSLMethodOpts<any>) => void;
|
|
248
|
+
MANY7: (actionORMethodDef: GrammarAction<any> | DSLMethodOpts<any>) => void;
|
|
249
|
+
MANY8: (actionORMethodDef: GrammarAction<any> | DSLMethodOpts<any>) => void;
|
|
250
|
+
MANY9: (actionORMethodDef: GrammarAction<any> | DSLMethodOpts<any>) => void;
|
|
251
|
+
/**
|
|
252
|
+
* Parsing DSL method, that indicates a repetition of zero or more with a separator
|
|
253
|
+
* Token between the repetitions.
|
|
254
|
+
*
|
|
255
|
+
* Example:
|
|
256
|
+
*
|
|
257
|
+
* ```
|
|
258
|
+
* this.MANY_SEP({
|
|
259
|
+
* SEP:Comma,
|
|
260
|
+
* DEF: () => {
|
|
261
|
+
* this.CONSUME(Number};
|
|
262
|
+
* // ...
|
|
263
|
+
* })
|
|
264
|
+
* ```
|
|
265
|
+
*
|
|
266
|
+
* Note that because this DSL method always requires more than one argument the options object is always required
|
|
267
|
+
* and it is not possible to use a shorter form like in the MANY DSL method.
|
|
268
|
+
*
|
|
269
|
+
* Note that for the purposes of deciding on whether or not another iteration exists
|
|
270
|
+
* Only a single Token is examined (The separator). Therefore if the grammar being implemented is
|
|
271
|
+
* so "crazy" to require multiple tokens to identify an item separator please use the more basic DSL methods
|
|
272
|
+
* to implement it.
|
|
273
|
+
*
|
|
274
|
+
* As in CONSUME the index in the method name indicates the occurrence
|
|
275
|
+
* of the repetition production in it's top rule.
|
|
276
|
+
*
|
|
277
|
+
* @param options - An object defining the grammar of each iteration and the separator between iterations
|
|
278
|
+
*
|
|
279
|
+
*/
|
|
280
|
+
MANY_SEP: (options: ManySepMethodOpts<any>) => void;
|
|
281
|
+
MANY_SEP1: (options: ManySepMethodOpts<any>) => void;
|
|
282
|
+
MANY_SEP2: (options: ManySepMethodOpts<any>) => void;
|
|
283
|
+
MANY_SEP3: (options: ManySepMethodOpts<any>) => void;
|
|
284
|
+
MANY_SEP4: (options: ManySepMethodOpts<any>) => void;
|
|
285
|
+
MANY_SEP5: (options: ManySepMethodOpts<any>) => void;
|
|
286
|
+
MANY_SEP6: (options: ManySepMethodOpts<any>) => void;
|
|
287
|
+
MANY_SEP7: (options: ManySepMethodOpts<any>) => void;
|
|
288
|
+
MANY_SEP8: (options: ManySepMethodOpts<any>) => void;
|
|
289
|
+
MANY_SEP9: (options: ManySepMethodOpts<any>) => void;
|
|
290
|
+
/**
|
|
291
|
+
* Convenience method, same as MANY but the repetition is of one or more.
|
|
292
|
+
* failing to match at least one repetition will result in a parsing error and
|
|
293
|
+
* cause a parsing error.
|
|
294
|
+
*
|
|
295
|
+
* @see MANY
|
|
296
|
+
*
|
|
297
|
+
* @param actionORMethodDef - The grammar action to optionally invoke multiple times
|
|
298
|
+
* or an "OPTIONS" object describing the grammar action and optional properties.
|
|
299
|
+
*
|
|
300
|
+
*/
|
|
301
|
+
AT_LEAST_ONE: (actionORMethodDef: GrammarAction<any> | DSLMethodOptsWithErr<any>) => void;
|
|
302
|
+
AT_LEAST_ONE1: (actionORMethodDef: GrammarAction<any> | DSLMethodOptsWithErr<any>) => void;
|
|
303
|
+
AT_LEAST_ONE2: (actionORMethodDef: GrammarAction<any> | DSLMethodOptsWithErr<any>) => void;
|
|
304
|
+
AT_LEAST_ONE3: (actionORMethodDef: GrammarAction<any> | DSLMethodOptsWithErr<any>) => void;
|
|
305
|
+
AT_LEAST_ONE4: (actionORMethodDef: GrammarAction<any> | DSLMethodOptsWithErr<any>) => void;
|
|
306
|
+
AT_LEAST_ONE5: (actionORMethodDef: GrammarAction<any> | DSLMethodOptsWithErr<any>) => void;
|
|
307
|
+
AT_LEAST_ONE6: (actionORMethodDef: GrammarAction<any> | DSLMethodOptsWithErr<any>) => void;
|
|
308
|
+
AT_LEAST_ONE7: (actionORMethodDef: GrammarAction<any> | DSLMethodOptsWithErr<any>) => void;
|
|
309
|
+
AT_LEAST_ONE8: (actionORMethodDef: GrammarAction<any> | DSLMethodOptsWithErr<any>) => void;
|
|
310
|
+
AT_LEAST_ONE9: (actionORMethodDef: GrammarAction<any> | DSLMethodOptsWithErr<any>) => void;
|
|
311
|
+
/**
|
|
312
|
+
* Convenience method, same as MANY_SEP but the repetition is of one or more.
|
|
313
|
+
* failing to match at least one repetition will result in a parsing error and
|
|
314
|
+
* cause the parser to attempt error recovery.
|
|
315
|
+
*
|
|
316
|
+
* Note that an additional optional property ERR_MSG can be used to provide custom error messages.
|
|
317
|
+
*
|
|
318
|
+
* @see MANY_SEP
|
|
319
|
+
*
|
|
320
|
+
* @param options - An object defining the grammar of each iteration and the separator between iterations
|
|
321
|
+
*
|
|
322
|
+
* @return ISeparatedIterationResult<OUT>
|
|
323
|
+
*/
|
|
324
|
+
AT_LEAST_ONE_SEP: (options: AtLeastOneSepMethodOpts<any>) => void;
|
|
325
|
+
AT_LEAST_ONE_SEP1: (options: AtLeastOneSepMethodOpts<any>) => void;
|
|
326
|
+
AT_LEAST_ONE_SEP2: (options: AtLeastOneSepMethodOpts<any>) => void;
|
|
327
|
+
AT_LEAST_ONE_SEP3: (options: AtLeastOneSepMethodOpts<any>) => void;
|
|
328
|
+
AT_LEAST_ONE_SEP4: (options: AtLeastOneSepMethodOpts<any>) => void;
|
|
329
|
+
AT_LEAST_ONE_SEP5: (options: AtLeastOneSepMethodOpts<any>) => void;
|
|
330
|
+
AT_LEAST_ONE_SEP6: (options: AtLeastOneSepMethodOpts<any>) => void;
|
|
331
|
+
AT_LEAST_ONE_SEP7: (options: AtLeastOneSepMethodOpts<any>) => void;
|
|
332
|
+
AT_LEAST_ONE_SEP8: (options: AtLeastOneSepMethodOpts<any>) => void;
|
|
333
|
+
AT_LEAST_ONE_SEP9: (options: AtLeastOneSepMethodOpts<any>) => void;
|
|
334
|
+
ACTION: <T>(impl: () => T) => T;
|
|
335
|
+
BACKTRACK: BacktrackFunc;
|
|
336
|
+
SUBRULE: SubRuleFunc;
|
|
337
|
+
SUBRULE1: SubRuleFunc;
|
|
338
|
+
SUBRULE2: SubRuleFunc;
|
|
339
|
+
SUBRULE3: SubRuleFunc;
|
|
340
|
+
SUBRULE4: SubRuleFunc;
|
|
341
|
+
SUBRULE5: SubRuleFunc;
|
|
342
|
+
SUBRULE6: SubRuleFunc;
|
|
343
|
+
SUBRULE7: SubRuleFunc;
|
|
344
|
+
SUBRULE8: SubRuleFunc;
|
|
345
|
+
SUBRULE9: SubRuleFunc;
|
|
346
|
+
}
|
|
347
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ruleDefTypes.js","sourceRoot":"","sources":["ruleDefTypes.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n AtLeastOneSepMethodOpts,\n DSLMethodOpts,\n DSLMethodOptsWithErr,\n GrammarAction,\n IOrAlt,\n ManySepMethodOpts,\n OrMethodOpts,\n} from '@chevrotain/types';\nimport type { ConsumeMethodOpts, IToken, TokenType } from 'chevrotain';\n\n/**\n * Get the return-type of a RuleDef\n */\nexport type RuleDefReturn<T extends ParserRule> = T extends ParserRule<any, string, infer Ret> ? Ret : never;\n\n/**\n * Type used to declare grammar rules.\n */\nexport type ParserRule<\n /**\n * Context object available in rule implementation.\n */\n Context = any,\n /**\n * Name of grammar rule, should be a strict subtype of string like 'myGrammarRule'.\n */\n NameType extends string = string,\n /**\n * Type that will be returned after a correct parse of this rule.\n * This type will be the return type of calling SUBRULE with this grammar rule.\n */\n ReturnType = unknown,\n /**\n * Function arguments that can be given to convey the state of the current parse operation.\n */\n ParamType = any,\n> = {\n name: NameType;\n impl: (def: ImplArgs) => (context: Context, params: ParamType) => ReturnType;\n};\n\n/**\n * Type expected by grammar rules in the main `impl` function.\n */\nexport interface ImplArgs extends CstDef {\n cache: WeakMap<ParserRule, unknown>;\n}\n\n/**\n * Type definition used by {@link CstDef.SUBRULE} and family.\n */\ntype SubRuleFunc = <T extends string, U = unknown, ARGS = any>(\n cstDef: ParserRule<any, T, U, ARGS>,\n argument: ARGS\n) => U;\n/**\n * Type definition used by {@link CstDef.BACKTRACK}.\n */\ntype BacktrackFunc = <T extends string, U = unknown, ARGS = any>(\n cstDef: ParserRule<any, T, U, ARGS>,\n argument: ARGS\n) => () => boolean;\n\n/**\n * Mainly a repetition of the functions exposed by the {@link EmbeddedActionsParser},\n * with some small adjustments that allow for the API changes made by traqula.\n * Specifically changes are made to the {@link CstDef.SUBRULE} (and family) interface,\n * and to the {@link CstDef.BACKTRACK} interface.\n */\nexport interface CstDef {\n /**\n *\n * A Parsing DSL method use to consume a single Token.\n * In EBNF terms this is equivalent to a Terminal.\n *\n * A Token will be consumed, IFF the next token in the token vector matches `tokType`.\n * otherwise the parser may attempt to perform error recovery (if enabled).\n *\n * The index in the method name indicates the unique occurrence of a terminal consumption\n * inside a the top level rule. What this means is that if a terminal appears\n * more than once in a single rule, each appearance must have a **different** index.\n *\n * For example:\n * ```\n * this.RULE(\"qualifiedName\", () => {\n * this.CONSUME1(Identifier);\n * this.MANY(() => {\n * this.CONSUME1(Dot);\n * // here we use CONSUME2 because the terminal\n * // 'Identifier' has already appeared previously in the\n * // the rule 'parseQualifiedName'\n * this.CONSUME2(Identifier);\n * });\n * })\n * ```\n *\n * - See more details on the [unique suffixes requirement](http://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES).\n *\n * @param tokType - The Type of the token to be consumed.\n * @param options - optional properties to modify the behavior of CONSUME.\n */\n CONSUME: (tokType: TokenType, options?: ConsumeMethodOpts) => IToken;\n CONSUME1: (tokType: TokenType, options?: ConsumeMethodOpts) => IToken;\n CONSUME2: (tokType: TokenType, options?: ConsumeMethodOpts) => IToken;\n CONSUME3: (tokType: TokenType, options?: ConsumeMethodOpts) => IToken;\n CONSUME4: (tokType: TokenType, options?: ConsumeMethodOpts) => IToken;\n CONSUME5: (tokType: TokenType, options?: ConsumeMethodOpts) => IToken;\n CONSUME6: (tokType: TokenType, options?: ConsumeMethodOpts) => IToken;\n CONSUME7: (tokType: TokenType, options?: ConsumeMethodOpts) => IToken;\n CONSUME8: (tokType: TokenType, options?: ConsumeMethodOpts) => IToken;\n CONSUME9: (tokType: TokenType, options?: ConsumeMethodOpts) => IToken;\n /**\n * Parsing DSL Method that Indicates an Optional production.\n * in EBNF notation this is equivalent to: \"[...]\".\n *\n * Note that there are two syntax forms:\n * - Passing the grammar action directly:\n * ```\n * this.OPTION(() => {\n * this.CONSUME(Digit)}\n * );\n * ```\n *\n * - using an \"options\" object:\n * ```\n * this.OPTION({\n * GATE:predicateFunc,\n * DEF: () => {\n * this.CONSUME(Digit)\n * }});\n * ```\n *\n * The optional 'GATE' property in \"options\" object form can be used to add constraints\n * to invoking the grammar action.\n *\n * As in CONSUME the index in the method name indicates the occurrence\n * of the optional production in it's top rule.\n *\n * @param actionORMethodDef - The grammar action to optionally invoke once\n * or an \"OPTIONS\" object describing the grammar action and optional properties.\n *\n * @returns The `GrammarAction` return value (OUT) if the optional syntax is encountered\n * or `undefined` if not.\n */\n OPTION: <OUT>(\n actionORMethodDef: GrammarAction<OUT> | DSLMethodOpts<OUT>,\n ) => OUT | undefined;\n OPTION1: <OUT>(\n actionORMethodDef: GrammarAction<OUT> | DSLMethodOpts<OUT>,\n ) => OUT | undefined;\n OPTION2: <OUT>(\n actionORMethodDef: GrammarAction<OUT> | DSLMethodOpts<OUT>,\n ) => OUT | undefined;\n OPTION3: <OUT>(\n actionORMethodDef: GrammarAction<OUT> | DSLMethodOpts<OUT>,\n ) => OUT | undefined;\n OPTION4: <OUT>(\n actionORMethodDef: GrammarAction<OUT> | DSLMethodOpts<OUT>,\n ) => OUT | undefined;\n OPTION5: <OUT>(\n actionORMethodDef: GrammarAction<OUT> | DSLMethodOpts<OUT>,\n ) => OUT | undefined;\n OPTION6: <OUT>(\n actionORMethodDef: GrammarAction<OUT> | DSLMethodOpts<OUT>,\n ) => OUT | undefined;\n OPTION7: <OUT>(\n actionORMethodDef: GrammarAction<OUT> | DSLMethodOpts<OUT>,\n ) => OUT | undefined;\n OPTION8: <OUT>(\n actionORMethodDef: GrammarAction<OUT> | DSLMethodOpts<OUT>,\n ) => OUT | undefined;\n OPTION9: <OUT>(\n actionORMethodDef: GrammarAction<OUT> | DSLMethodOpts<OUT>,\n ) => OUT | undefined;\n /**\n * Parsing DSL method that indicates a choice between a set of alternatives must be made.\n * This is equivalent to an EBNF alternation (A | B | C | D ...), except\n * that the alternatives are ordered like in a PEG grammar.\n * This means that the **first** matching alternative is always chosen.\n *\n * There are several forms for the inner alternatives array:\n *\n * - Passing alternatives array directly:\n * ```\n * this.OR([\n * { ALT:() => { this.CONSUME(One) }},\n * { ALT:() => { this.CONSUME(Two) }},\n * { ALT:() => { this.CONSUME(Three) }}\n * ])\n * ```\n *\n * - Passing alternative array directly with predicates (GATE):\n * ```\n * this.OR([\n * { GATE: predicateFunc1, ALT:() => { this.CONSUME(One) }},\n * { GATE: predicateFuncX, ALT:() => { this.CONSUME(Two) }},\n * { GATE: predicateFuncX, ALT:() => { this.CONSUME(Three) }}\n * ])\n * ```\n *\n * - These syntax forms can also be mixed:\n * ```\n * this.OR([\n * {\n * GATE: predicateFunc1,\n * ALT:() => { this.CONSUME(One) }\n * },\n * { ALT:() => { this.CONSUME(Two) }},\n * { ALT:() => { this.CONSUME(Three) }}\n * ])\n * ```\n *\n * - Additionally an \"options\" object may be used:\n * ```\n * this.OR({\n * DEF:[\n * { ALT:() => { this.CONSUME(One) }},\n * { ALT:() => { this.CONSUME(Two) }},\n * { ALT:() => { this.CONSUME(Three) }}\n * ],\n * // OPTIONAL property\n * ERR_MSG: \"A Number\"\n * })\n * ```\n *\n * The 'predicateFuncX' in the long form can be used to add constraints to choosing the alternative.\n *\n * As in CONSUME the index in the method name indicates the occurrence\n * of the alternation production in it's top rule.\n *\n * @param altsOrOpts - A set of alternatives or an \"OPTIONS\" object describing the alternatives\n * and optional properties.\n *\n * @returns The result of invoking the chosen alternative.\n */\n OR: <T>(altsOrOpts: IOrAlt<T>[] | OrMethodOpts<T>) => T;\n OR1: <T>(altsOrOpts: IOrAlt<T>[] | OrMethodOpts<T>) => T;\n OR2: <T>(altsOrOpts: IOrAlt<T>[] | OrMethodOpts<T>) => T;\n OR3: <T>(altsOrOpts: IOrAlt<T>[] | OrMethodOpts<T>) => T;\n OR4: <T>(altsOrOpts: IOrAlt<T>[] | OrMethodOpts<T>) => T;\n OR5: <T>(altsOrOpts: IOrAlt<T>[] | OrMethodOpts<T>) => T;\n OR6: <T>(altsOrOpts: IOrAlt<T>[] | OrMethodOpts<T>) => T;\n OR7: <T>(altsOrOpts: IOrAlt<T>[] | OrMethodOpts<T>) => T;\n OR8: <T>(altsOrOpts: IOrAlt<T>[] | OrMethodOpts<T>) => T;\n OR9: <T>(altsOrOpts: IOrAlt<T>[] | OrMethodOpts<T>) => T;\n /**\n * Parsing DSL method, that indicates a repetition of zero or more.\n * This is equivalent to EBNF repetition \\{...\\}.\n *\n * Note that there are two syntax forms:\n * - Passing the grammar action directly:\n * ```\n * this.MANY(() => {\n * this.CONSUME(Comma)\n * this.CONSUME(Digit)\n * })\n * ```\n *\n * - using an \"options\" object:\n * ```\n * this.MANY({\n * GATE: predicateFunc,\n * DEF: () => {\n * this.CONSUME(Comma)\n * this.CONSUME(Digit)\n * }\n * });\n * ```\n *\n * The optional 'GATE' property in \"options\" object form can be used to add constraints\n * to invoking the grammar action.\n *\n * As in CONSUME the index in the method name indicates the occurrence\n * of the repetition production in it's top rule.\n *\n * @param actionORMethodDef - The grammar action to optionally invoke multiple times\n * or an \"OPTIONS\" object describing the grammar action and optional properties.\n *\n */\n MANY: (\n actionORMethodDef: GrammarAction<any> | DSLMethodOpts<any>,\n ) => void;\n MANY1: (\n actionORMethodDef: GrammarAction<any> | DSLMethodOpts<any>,\n ) => void;\n MANY2: (\n actionORMethodDef: GrammarAction<any> | DSLMethodOpts<any>,\n ) => void;\n MANY3: (\n actionORMethodDef: GrammarAction<any> | DSLMethodOpts<any>,\n ) => void;\n MANY4: (\n actionORMethodDef: GrammarAction<any> | DSLMethodOpts<any>,\n ) => void;\n MANY5: (\n actionORMethodDef: GrammarAction<any> | DSLMethodOpts<any>,\n ) => void;\n MANY6: (\n actionORMethodDef: GrammarAction<any> | DSLMethodOpts<any>,\n ) => void;\n MANY7: (\n actionORMethodDef: GrammarAction<any> | DSLMethodOpts<any>,\n ) => void;\n MANY8: (\n actionORMethodDef: GrammarAction<any> | DSLMethodOpts<any>,\n ) => void;\n MANY9: (\n actionORMethodDef: GrammarAction<any> | DSLMethodOpts<any>,\n ) => void;\n /**\n * Parsing DSL method, that indicates a repetition of zero or more with a separator\n * Token between the repetitions.\n *\n * Example:\n *\n * ```\n * this.MANY_SEP({\n * SEP:Comma,\n * DEF: () => {\n * this.CONSUME(Number};\n * // ...\n * })\n * ```\n *\n * Note that because this DSL method always requires more than one argument the options object is always required\n * and it is not possible to use a shorter form like in the MANY DSL method.\n *\n * Note that for the purposes of deciding on whether or not another iteration exists\n * Only a single Token is examined (The separator). Therefore if the grammar being implemented is\n * so \"crazy\" to require multiple tokens to identify an item separator please use the more basic DSL methods\n * to implement it.\n *\n * As in CONSUME the index in the method name indicates the occurrence\n * of the repetition production in it's top rule.\n *\n * @param options - An object defining the grammar of each iteration and the separator between iterations\n *\n */\n MANY_SEP: (options: ManySepMethodOpts<any>) => void;\n MANY_SEP1: (options: ManySepMethodOpts<any>) => void;\n MANY_SEP2: (options: ManySepMethodOpts<any>) => void;\n MANY_SEP3: (options: ManySepMethodOpts<any>) => void;\n MANY_SEP4: (options: ManySepMethodOpts<any>) => void;\n MANY_SEP5: (options: ManySepMethodOpts<any>) => void;\n MANY_SEP6: (options: ManySepMethodOpts<any>) => void;\n MANY_SEP7: (options: ManySepMethodOpts<any>) => void;\n MANY_SEP8: (options: ManySepMethodOpts<any>) => void;\n MANY_SEP9: (options: ManySepMethodOpts<any>) => void;\n /**\n * Convenience method, same as MANY but the repetition is of one or more.\n * failing to match at least one repetition will result in a parsing error and\n * cause a parsing error.\n *\n * @see MANY\n *\n * @param actionORMethodDef - The grammar action to optionally invoke multiple times\n * or an \"OPTIONS\" object describing the grammar action and optional properties.\n *\n */\n AT_LEAST_ONE: (\n actionORMethodDef: GrammarAction<any> | DSLMethodOptsWithErr<any>,\n ) => void;\n AT_LEAST_ONE1: (\n actionORMethodDef: GrammarAction<any> | DSLMethodOptsWithErr<any>,\n ) => void;\n AT_LEAST_ONE2: (\n actionORMethodDef: GrammarAction<any> | DSLMethodOptsWithErr<any>,\n ) => void;\n AT_LEAST_ONE3: (\n actionORMethodDef: GrammarAction<any> | DSLMethodOptsWithErr<any>,\n ) => void;\n AT_LEAST_ONE4: (\n actionORMethodDef: GrammarAction<any> | DSLMethodOptsWithErr<any>,\n ) => void;\n AT_LEAST_ONE5: (\n actionORMethodDef: GrammarAction<any> | DSLMethodOptsWithErr<any>,\n ) => void;\n AT_LEAST_ONE6: (\n actionORMethodDef: GrammarAction<any> | DSLMethodOptsWithErr<any>,\n ) => void;\n AT_LEAST_ONE7: (\n actionORMethodDef: GrammarAction<any> | DSLMethodOptsWithErr<any>,\n ) => void;\n AT_LEAST_ONE8: (\n actionORMethodDef: GrammarAction<any> | DSLMethodOptsWithErr<any>,\n ) => void;\n AT_LEAST_ONE9: (\n actionORMethodDef: GrammarAction<any> | DSLMethodOptsWithErr<any>,\n ) => void;\n /**\n * Convenience method, same as MANY_SEP but the repetition is of one or more.\n * failing to match at least one repetition will result in a parsing error and\n * cause the parser to attempt error recovery.\n *\n * Note that an additional optional property ERR_MSG can be used to provide custom error messages.\n *\n * @see MANY_SEP\n *\n * @param options - An object defining the grammar of each iteration and the separator between iterations\n *\n * @return ISeparatedIterationResult<OUT>\n */\n AT_LEAST_ONE_SEP: (options: AtLeastOneSepMethodOpts<any>) => void;\n AT_LEAST_ONE_SEP1: (options: AtLeastOneSepMethodOpts<any>) => void;\n AT_LEAST_ONE_SEP2: (options: AtLeastOneSepMethodOpts<any>) => void;\n AT_LEAST_ONE_SEP3: (options: AtLeastOneSepMethodOpts<any>) => void;\n AT_LEAST_ONE_SEP4: (options: AtLeastOneSepMethodOpts<any>) => void;\n AT_LEAST_ONE_SEP5: (options: AtLeastOneSepMethodOpts<any>) => void;\n AT_LEAST_ONE_SEP6: (options: AtLeastOneSepMethodOpts<any>) => void;\n AT_LEAST_ONE_SEP7: (options: AtLeastOneSepMethodOpts<any>) => void;\n AT_LEAST_ONE_SEP8: (options: AtLeastOneSepMethodOpts<any>) => void;\n AT_LEAST_ONE_SEP9: (options: AtLeastOneSepMethodOpts<any>) => void;\n ACTION: <T>(impl: () => T) => T;\n BACKTRACK: BacktrackFunc;\n SUBRULE: SubRuleFunc;\n SUBRULE1: SubRuleFunc;\n SUBRULE2: SubRuleFunc;\n SUBRULE3: SubRuleFunc;\n SUBRULE4: SubRuleFunc;\n SUBRULE5: SubRuleFunc;\n SUBRULE6: SubRuleFunc;\n SUBRULE7: SubRuleFunc;\n SUBRULE8: SubRuleFunc;\n SUBRULE9: SubRuleFunc;\n}\n"]}
|
package/lib/utils.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ITokenConfig, TokenType } from '@chevrotain/types';
|
|
2
|
+
/**
|
|
3
|
+
* Check whether the first two types overlap, if no, return the 3th argument, else the 4th.
|
|
4
|
+
*/
|
|
5
|
+
export type CheckOverlap<T, U, V, W = never> = T & U extends never ? V : W;
|
|
6
|
+
export declare function unCapitalize<T extends string>(str: T): Uncapitalize<T>;
|
|
7
|
+
export type NamedToken<Name extends string> = TokenType & {
|
|
8
|
+
name: Name;
|
|
9
|
+
};
|
|
10
|
+
export declare function createToken<Name extends string>(config: ITokenConfig & {
|
|
11
|
+
name: Name;
|
|
12
|
+
}): NamedToken<Name>;
|
|
13
|
+
export type Patch<T extends object, Patch extends {
|
|
14
|
+
[Key in keyof T]?: unknown;
|
|
15
|
+
}> = {
|
|
16
|
+
[Key in keyof T]: Key extends keyof Patch ? Patch[Key] : T[Key];
|
|
17
|
+
};
|
package/lib/utils.js
ADDED
package/lib/utils.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,IAAI,MAAM,EAAE,MAAM,YAAY,CAAC;AAOnD,MAAM,UAAU,YAAY,CAAmB,GAAM;IACnD,OAAyB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AACxE,CAAC;AAID,MAAM,UAAU,WAAW,CAAsB,MAAqC;IACpF,OAAoC,MAAM,CAAC,MAAM,CAAC,CAAC;AACrD,CAAC","sourcesContent":["import type { ITokenConfig, TokenType } from '@chevrotain/types';\nimport { createToken as chevcT } from 'chevrotain';\n\n/**\n * Check whether the first two types overlap, if no, return the 3th argument, else the 4th.\n */\nexport type CheckOverlap<T, U, V, W = never> = T & U extends never ? V : W;\n\nexport function unCapitalize<T extends string>(str: T): Uncapitalize<T> {\n return <Uncapitalize<T>> (str.charAt(0).toLowerCase() + str.slice(1));\n}\n\nexport type NamedToken<Name extends string> = TokenType & { name: Name };\n\nexport function createToken<Name extends string>(config: ITokenConfig & { name: Name }): NamedToken<Name> {\n return <TokenType & { name: Name }> chevcT(config);\n}\n\nexport type Patch<T extends object, Patch extends {[Key in keyof T ]?: unknown }> =\n {[Key in keyof T]: Key extends keyof Patch ? Patch[Key] : T[Key] };\n"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@traqula/core",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.0.1-alpha.10+6cb01a3",
|
|
5
|
+
"description": "Core components of Traqula",
|
|
6
|
+
"lsd:module": true,
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/comunica/traqula.git",
|
|
11
|
+
"directory": "packages/core"
|
|
12
|
+
},
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/comunica/traqula/issues"
|
|
15
|
+
},
|
|
16
|
+
"sideEffects": false,
|
|
17
|
+
"exports": {
|
|
18
|
+
"import": "./lib/index.js",
|
|
19
|
+
"require": "./lib/index.cjs"
|
|
20
|
+
},
|
|
21
|
+
"main": "lib/index.js",
|
|
22
|
+
"publishConfig": {
|
|
23
|
+
"access": "public"
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"lib/**/*.cjs",
|
|
27
|
+
"lib/**/*.d.ts",
|
|
28
|
+
"lib/**/*.js",
|
|
29
|
+
"lib/**/*.js.map"
|
|
30
|
+
],
|
|
31
|
+
"engines": {
|
|
32
|
+
"node": ">=18.0"
|
|
33
|
+
},
|
|
34
|
+
"typings": "lib/index",
|
|
35
|
+
"scripts": {
|
|
36
|
+
"build": "yarn build:ts && yarn build:transpile",
|
|
37
|
+
"build:ts": "node \"../../node_modules/typescript/bin/tsc\"",
|
|
38
|
+
"build:transpile": "node \"../../node_modules/esbuild/bin/esbuild\" --format=cjs --bundle --log-level=error --outfile=lib/index.cjs lib/index.ts"
|
|
39
|
+
},
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"chevrotain": "^11.0.3"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@chevrotain/types": "^11.0.3"
|
|
45
|
+
},
|
|
46
|
+
"gitHead": "6cb01a3af7ea01e7bcd5aaba638cf74fb45db76b"
|
|
47
|
+
}
|