mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-22 14:54:43 +08:00
Remove unnecessary default attributes
This commit is contained in:
@@ -60,6 +60,14 @@ export default class IEntity {
|
||||
this.#ignored = value
|
||||
}
|
||||
|
||||
#inlined = /** @type {typeof IEntity} */(this.constructor).inlined
|
||||
get inlined() {
|
||||
return this.#inlined
|
||||
}
|
||||
set inlined(value) {
|
||||
this.#inlined = value
|
||||
}
|
||||
|
||||
#quoted
|
||||
get quoted() {
|
||||
return this.#quoted ?? /** @type {typeof IEntity} */(this.constructor).quoted ?? false
|
||||
@@ -330,7 +338,7 @@ export default class IEntity {
|
||||
if (keyValue.length && (Self.attributes[key]?.quoted || value.quoted)) {
|
||||
keyValue = `"${keyValue}"`
|
||||
}
|
||||
if (valueType.inlined) {
|
||||
if (value.inlined) {
|
||||
const inlinedPrintKey = valueType.className() === "ArrayEntity"
|
||||
? k => printKey(`${keyValue}${k}`)
|
||||
: k => printKey(`${keyValue}.${k}`)
|
||||
|
||||
@@ -88,11 +88,11 @@ export default class PinEntity extends IEntity {
|
||||
AutogeneratedDefaultValue: StringEntity,
|
||||
DefaultObject: ObjectReferenceEntity,
|
||||
PersistentGuid: GuidEntity,
|
||||
bHidden: BooleanEntity.withDefault(),
|
||||
bNotConnectable: BooleanEntity.withDefault(),
|
||||
bDefaultValueIsReadOnly: BooleanEntity.withDefault(),
|
||||
bDefaultValueIsIgnored: BooleanEntity.withDefault(),
|
||||
bAdvancedView: BooleanEntity.withDefault(),
|
||||
bHidden: BooleanEntity,
|
||||
bNotConnectable: BooleanEntity,
|
||||
bDefaultValueIsReadOnly: BooleanEntity,
|
||||
bDefaultValueIsIgnored: BooleanEntity,
|
||||
bAdvancedView: BooleanEntity,
|
||||
bOrphanedPin: BooleanEntity,
|
||||
}
|
||||
static grammar = this.createGrammar()
|
||||
|
||||
@@ -12,7 +12,7 @@ export default class PinTypeEntity extends IEntity {
|
||||
static attributes = {
|
||||
...super.attributes,
|
||||
PinCategory: StringEntity.withDefault(),
|
||||
PinSubCategory: StringEntity.withDefault(),
|
||||
PinSubCategory: StringEntity,
|
||||
PinSubCategoryObject: ObjectReferenceEntity,
|
||||
PinSubCategoryMemberReference: FunctionReferenceEntity,
|
||||
ContainerType: SymbolEntity,
|
||||
|
||||
@@ -1,15 +1,22 @@
|
||||
import P from "parsernostrum"
|
||||
import Grammar from "../serialization/Grammar.js"
|
||||
import GuidEntity from "./GuidEntity.js"
|
||||
import PinEntity from "./PinEntity.js"
|
||||
|
||||
export default class UnknownPinEntity extends PinEntity {
|
||||
|
||||
static attributes = {
|
||||
...super.attributes,
|
||||
PinId: GuidEntity
|
||||
}
|
||||
|
||||
static grammar = this.createGrammar()
|
||||
|
||||
/** @returns {P<UnknownPinEntity>} */
|
||||
static createGrammar() {
|
||||
return P.seq(
|
||||
P.reg(new RegExp(`(${Grammar.Regex.Symbol.source})\\s*\\(\\s*`), 1),
|
||||
// Lookbehind
|
||||
P.reg(new RegExp(`(${Grammar.Regex.Symbol.source}\\s*)\\(\\s*`), 1),
|
||||
Grammar.createAttributeGrammar(this).sepBy(Grammar.commaSeparation),
|
||||
P.reg(/\s*(?:,\s*)?\)/)
|
||||
).map(([lookbehind, attributes, _2]) => {
|
||||
|
||||
Reference in New Issue
Block a user