mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-05-21 05:27:34 +08:00
Fix ScriptVariables parsing
This commit is contained in:
44
dist/ueblueprint.js
vendored
44
dist/ueblueprint.js
vendored
@@ -4482,8 +4482,7 @@ class ArrayEntity extends IEntity {
|
|||||||
if ((trailing !== undefined) !== Self.trailing) {
|
if ((trailing !== undefined) !== Self.trailing) {
|
||||||
Self = Self.flagTrailing(trailing !== undefined);
|
Self = Self.flagTrailing(trailing !== undefined);
|
||||||
}
|
}
|
||||||
const result = new Self(values);
|
return new Self(values)
|
||||||
return result
|
|
||||||
}).label(`ArrayEntity of ${this.type?.className() ?? "unknown values"}`)
|
}).label(`ArrayEntity of ${this.type?.className() ?? "unknown values"}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6239,7 +6238,7 @@ class ObjectEntity extends IEntity {
|
|||||||
NodeGuid: GuidEntity,
|
NodeGuid: GuidEntity,
|
||||||
ErrorType: IntegerEntity,
|
ErrorType: IntegerEntity,
|
||||||
ErrorMsg: StringEntity,
|
ErrorMsg: StringEntity,
|
||||||
ScriptVariables: ArrayEntity.of(ScriptVariableEntity),
|
ScriptVariables: ArrayEntity.flagInlined().of(ScriptVariableEntity),
|
||||||
Node: MirroredEntity.of(ObjectReferenceEntity),
|
Node: MirroredEntity.of(ObjectReferenceEntity),
|
||||||
ExportedNodes: StringEntity,
|
ExportedNodes: StringEntity,
|
||||||
CustomProperties: ArrayEntity.of(AlternativesEntity.accepting(PinEntity, UnknownPinEntity)).withDefault().flagSilent(),
|
CustomProperties: ArrayEntity.of(AlternativesEntity.accepting(PinEntity, UnknownPinEntity)).withDefault().flagSilent(),
|
||||||
@@ -6258,28 +6257,27 @@ class ObjectEntity extends IEntity {
|
|||||||
Grammar.symbol.map(v => [v, false]),
|
Grammar.symbol.map(v => [v, false]),
|
||||||
),
|
),
|
||||||
Parsernostrum.reg(new RegExp(String.raw`\s*\(\s*(\d+)\s*\)\s*\=\s*`), 1).map(Number)
|
Parsernostrum.reg(new RegExp(String.raw`\s*\(\s*(\d+)\s*\)\s*\=\s*`), 1).map(Number)
|
||||||
)
|
).chain(
|
||||||
.chain(
|
/** @param {[[keyof ObjectEntity.attributes, Boolean], Number]} param */
|
||||||
/** @param {[[keyof ObjectEntity.attributes, Boolean], Number]} param */
|
([[symbol, quoted], index]) =>
|
||||||
([[symbol, quoted], index]) =>
|
(this.attributes[symbol]?.grammar ?? IEntity.unknownEntityGrammar).map(currentValue =>
|
||||||
(this.attributes[symbol]?.grammar ?? IEntity.unknownEntityGrammar).map(currentValue =>
|
values => {
|
||||||
values => {
|
if (values[symbol] === undefined) {
|
||||||
if (values[symbol] === undefined) {
|
let arrayEntity = ArrayEntity;
|
||||||
let arrayEntity = ArrayEntity;
|
if (quoted != arrayEntity.quoted) {
|
||||||
if (quoted != arrayEntity.quoted) {
|
arrayEntity = arrayEntity.flagQuoted(quoted);
|
||||||
arrayEntity = arrayEntity.flagQuoted(quoted);
|
|
||||||
}
|
|
||||||
if (!arrayEntity.inlined) {
|
|
||||||
arrayEntity = arrayEntity.flagInlined();
|
|
||||||
}
|
|
||||||
values[symbol] = new arrayEntity();
|
|
||||||
}
|
}
|
||||||
/** @type {ArrayEntity} */
|
if (!arrayEntity.inlined) {
|
||||||
const target = values[symbol];
|
arrayEntity = arrayEntity.flagInlined();
|
||||||
target.values[index] = currentValue;
|
}
|
||||||
|
values[symbol] = new arrayEntity();
|
||||||
}
|
}
|
||||||
)
|
/** @type {ArrayEntity} */
|
||||||
)
|
const target = values[symbol];
|
||||||
|
target.values[index] = currentValue;
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
static grammar = this.createGrammar()
|
static grammar = this.createGrammar()
|
||||||
static grammarMultipleObjects = Parsernostrum.seq(
|
static grammarMultipleObjects = Parsernostrum.seq(
|
||||||
Parsernostrum.whitespaceOpt,
|
Parsernostrum.whitespaceOpt,
|
||||||
|
|||||||
2
dist/ueblueprint.min.js
vendored
2
dist/ueblueprint.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -33,8 +33,7 @@ export default class ArrayEntity extends IEntity {
|
|||||||
if ((trailing !== undefined) !== Self.trailing) {
|
if ((trailing !== undefined) !== Self.trailing) {
|
||||||
Self = Self.flagTrailing(trailing !== undefined)
|
Self = Self.flagTrailing(trailing !== undefined)
|
||||||
}
|
}
|
||||||
const result = new Self(values)
|
return new Self(values)
|
||||||
return result
|
|
||||||
}).label(`ArrayEntity of ${this.type?.className() ?? "unknown values"}`)
|
}).label(`ArrayEntity of ${this.type?.className() ?? "unknown values"}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ export default class ObjectEntity extends IEntity {
|
|||||||
NodeGuid: GuidEntity,
|
NodeGuid: GuidEntity,
|
||||||
ErrorType: IntegerEntity,
|
ErrorType: IntegerEntity,
|
||||||
ErrorMsg: StringEntity,
|
ErrorMsg: StringEntity,
|
||||||
ScriptVariables: ArrayEntity.of(ScriptVariableEntity),
|
ScriptVariables: ArrayEntity.flagInlined().of(ScriptVariableEntity),
|
||||||
Node: MirroredEntity.of(ObjectReferenceEntity),
|
Node: MirroredEntity.of(ObjectReferenceEntity),
|
||||||
ExportedNodes: StringEntity,
|
ExportedNodes: StringEntity,
|
||||||
CustomProperties: ArrayEntity.of(AlternativesEntity.accepting(PinEntity, UnknownPinEntity)).withDefault().flagSilent(),
|
CustomProperties: ArrayEntity.of(AlternativesEntity.accepting(PinEntity, UnknownPinEntity)).withDefault().flagSilent(),
|
||||||
@@ -155,28 +155,27 @@ export default class ObjectEntity extends IEntity {
|
|||||||
Grammar.symbol.map(v => [v, false]),
|
Grammar.symbol.map(v => [v, false]),
|
||||||
),
|
),
|
||||||
P.reg(new RegExp(String.raw`\s*\(\s*(\d+)\s*\)\s*\=\s*`), 1).map(Number)
|
P.reg(new RegExp(String.raw`\s*\(\s*(\d+)\s*\)\s*\=\s*`), 1).map(Number)
|
||||||
)
|
).chain(
|
||||||
.chain(
|
/** @param {[[keyof ObjectEntity.attributes, Boolean], Number]} param */
|
||||||
/** @param {[[keyof ObjectEntity.attributes, Boolean], Number]} param */
|
([[symbol, quoted], index]) =>
|
||||||
([[symbol, quoted], index]) =>
|
(this.attributes[symbol]?.grammar ?? IEntity.unknownEntityGrammar).map(currentValue =>
|
||||||
(this.attributes[symbol]?.grammar ?? IEntity.unknownEntityGrammar).map(currentValue =>
|
values => {
|
||||||
values => {
|
if (values[symbol] === undefined) {
|
||||||
if (values[symbol] === undefined) {
|
let arrayEntity = ArrayEntity
|
||||||
let arrayEntity = ArrayEntity
|
if (quoted != arrayEntity.quoted) {
|
||||||
if (quoted != arrayEntity.quoted) {
|
arrayEntity = arrayEntity.flagQuoted(quoted)
|
||||||
arrayEntity = arrayEntity.flagQuoted(quoted)
|
|
||||||
}
|
|
||||||
if (!arrayEntity.inlined) {
|
|
||||||
arrayEntity = arrayEntity.flagInlined()
|
|
||||||
}
|
|
||||||
values[symbol] = new arrayEntity()
|
|
||||||
}
|
}
|
||||||
/** @type {ArrayEntity} */
|
if (!arrayEntity.inlined) {
|
||||||
const target = values[symbol]
|
arrayEntity = arrayEntity.flagInlined()
|
||||||
target.values[index] = currentValue
|
}
|
||||||
|
values[symbol] = new arrayEntity()
|
||||||
}
|
}
|
||||||
)
|
/** @type {ArrayEntity} */
|
||||||
)
|
const target = values[symbol]
|
||||||
|
target.values[index] = currentValue
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
static grammar = this.createGrammar()
|
static grammar = this.createGrammar()
|
||||||
static grammarMultipleObjects = P.seq(
|
static grammarMultipleObjects = P.seq(
|
||||||
P.whitespaceOpt,
|
P.whitespaceOpt,
|
||||||
|
|||||||
Reference in New Issue
Block a user