mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-28 03:24:43 +08:00
Tests for various entity classes and update entity class implementations
This commit is contained in:
@@ -6,6 +6,7 @@ import StringEntity from "./StringEntity.js"
|
||||
|
||||
export default class FormatTextEntity extends IPrintableEntity {
|
||||
|
||||
static attributeSeparator = ", "
|
||||
static lookbehind = ["LOCGEN_FORMAT_NAMED", "LOCGEN_FORMAT_ORDERED"]
|
||||
/** @type {P<FormatTextEntity>} */
|
||||
static grammar = P.lazy(() => P.seq(
|
||||
@@ -53,4 +54,16 @@ export default class FormatTextEntity extends IPrintableEntity {
|
||||
: ""
|
||||
return result
|
||||
}
|
||||
|
||||
toString(
|
||||
insideString = false,
|
||||
indentation = "",
|
||||
printKey = this.Self().printKey,
|
||||
) {
|
||||
const separator = this.Self().attributeSeparator
|
||||
return this.lookbehind + "("
|
||||
+ this.values.map(v => v.toString(insideString)).join(separator)
|
||||
+ (this.Self().trailing ? separator : "")
|
||||
+ ")"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user