feat: support passing in a Rust regex in the grammar dsl
This commit is contained in:
parent
4170f71dbc
commit
68e707eb4f
4 changed files with 35 additions and 4 deletions
10
cli/npm/dsl.d.ts
vendored
10
cli/npm/dsl.d.ts
vendored
|
|
@ -33,7 +33,15 @@ type Rule =
|
|||
| SymbolRule<string>
|
||||
| TokenRule;
|
||||
|
||||
type RuleOrLiteral = Rule | RegExp | string;
|
||||
class RustRegex {
|
||||
value: string;
|
||||
|
||||
constructor(pattern: string) {
|
||||
this.value = pattern;
|
||||
}
|
||||
}
|
||||
|
||||
type RuleOrLiteral = Rule | RegExp | RustRegex | string;
|
||||
|
||||
type GrammarSymbols<RuleName extends string> = {
|
||||
[name in RuleName]: SymbolRule<name>;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue