mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-16 10:54:42 +08:00
Still WIP
This commit is contained in:
22
js/entity/StringEntity.js
Executable file
22
js/entity/StringEntity.js
Executable file
@@ -0,0 +1,22 @@
|
||||
import P from "parsernostrum"
|
||||
import IEntity from "./IEntity.js"
|
||||
import Utility from "../Utility.js"
|
||||
|
||||
export default class StringEntity extends IEntity {
|
||||
|
||||
static grammar = P.doubleQuotedString.map(insideString => Utility.unescapeString(insideString))
|
||||
|
||||
/** @param {String} value */
|
||||
constructor(value = "") {
|
||||
super()
|
||||
this.value = value
|
||||
}
|
||||
|
||||
valueOf() {
|
||||
return this.value
|
||||
}
|
||||
|
||||
toString() {
|
||||
return this.value.toString()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user