mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-14 00:54:48 +08:00
* Move grammar parsers to entity classes * Fix includes * Fix Entity5 test * Small detail * Fix unknown keys entities * Persistent grammar objects * Fix grammar * Grammar from variable
39 lines
830 B
JavaScript
Executable File
39 lines
830 B
JavaScript
Executable File
import Grammar from "../serialization/Grammar.js"
|
|
import IEntity from "./IEntity.js"
|
|
|
|
export default class PathSymbolEntity extends IEntity {
|
|
|
|
static attributes = {
|
|
...super.attributes,
|
|
value: {
|
|
default: "",
|
|
},
|
|
}
|
|
static {
|
|
this.cleanupAttributes(this.attributes)
|
|
}
|
|
static #grammar = Grammar.symbol.map(v => new PathSymbolEntity(v))
|
|
|
|
static createGrammar() {
|
|
return PathSymbolEntity.#grammar
|
|
}
|
|
|
|
constructor(values) {
|
|
if (values.constructor !== Object) {
|
|
values = {
|
|
value: values,
|
|
}
|
|
}
|
|
super(values)
|
|
/** @type {String} */ this.value
|
|
}
|
|
|
|
valueOf() {
|
|
return this.value
|
|
}
|
|
|
|
toString() {
|
|
return this.value
|
|
}
|
|
}
|