mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-05-17 19:03:27 +08:00
Better typing for grammars
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import P from "parsernostrum"
|
||||
import Grammar from "../serialization/Grammar.js"
|
||||
import IEntity from "./IEntity.js"
|
||||
|
||||
@@ -7,7 +8,9 @@ export default class SymbolEntity extends IEntity {
|
||||
fromAttribute: (value, type) => new this(value),
|
||||
toAttribute: (value, type) => value.toString()
|
||||
}
|
||||
static grammar = Grammar.symbol.map(v => new this(v)).label("SymbolEntity")
|
||||
static grammar = /** @type {P<SymbolEntity>} */(
|
||||
Grammar.symbol.map(v => new this(v)).label("SymbolEntity")
|
||||
)
|
||||
|
||||
constructor(value = "") {
|
||||
super()
|
||||
|
||||
Reference in New Issue
Block a user