mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-21 14:24:47 +08:00
Better typing for grammars
This commit is contained in:
@@ -3,9 +3,11 @@ import IEntity from "./IEntity.js"
|
||||
|
||||
export default class NullEntity extends IEntity {
|
||||
|
||||
// @ts-expect-error
|
||||
static grammar = P.reg(new RegExp(String.raw`\(${P.whitespaceInlineOpt.getParser().regexp.source}\)`))
|
||||
.map(v => new this())
|
||||
static grammar = /** @type {P<NullEntity>} */(
|
||||
// @ts-expect-error
|
||||
P.reg(new RegExp(String.raw`\(${P.whitespaceInlineOpt.getParser().regexp.source}\)`))
|
||||
.map(v => new this())
|
||||
)
|
||||
|
||||
toString(
|
||||
insideString = false,
|
||||
|
||||
Reference in New Issue
Block a user