Better typing for grammars

This commit is contained in:
barsdeveloper
2024-06-06 23:16:21 +02:00
parent ad4ba2c46d
commit 98ebdd78b2
40 changed files with 301 additions and 233 deletions

View File

@@ -1,7 +1,10 @@
import P from "parsernostrum"
import Grammar from "../serialization/Grammar.js"
import SymbolEntity from "./SymbolEntity.js"
export default class EnumEntity extends SymbolEntity {
static grammar = Grammar.symbol.map(v => new this(v))
static grammar = /** @type {P<EnumEntity>} */(
Grammar.symbol.map(v => new this(v))
)
}