mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-04 08:50:33 +08:00
27 lines
669 B
JavaScript
27 lines
669 B
JavaScript
import P from "parsernostrum"
|
|
import IEntity from "./IEntity.js"
|
|
|
|
export default class NullEntity extends IEntity {
|
|
|
|
static grammar = this.createGrammar()
|
|
|
|
/** @returns {P<NullEntity>} */
|
|
static createGrammar() {
|
|
// @ts-expect-error
|
|
return P.reg(new RegExp(String.raw`\(${P.whitespaceInlineOpt.getParser().regexp.source}\)`))
|
|
.map(v => new this())
|
|
}
|
|
|
|
serialize(
|
|
insideString = false,
|
|
indentation = "",
|
|
Self = /** @type {typeof IEntity} */(this.constructor)
|
|
) {
|
|
let result = "()"
|
|
if (Self.serialized) {
|
|
result = `"${result}"`
|
|
}
|
|
return result
|
|
}
|
|
}
|