Minor fixes

This commit is contained in:
barsdeveloper
2024-09-09 16:55:52 +02:00
parent 4885a988f9
commit a763544b3b
7 changed files with 32 additions and 29 deletions

26
dist/ueblueprint.js vendored
View File

@@ -5251,14 +5251,14 @@ class PinTypeEntity extends IEntity {
...super.attributes,
PinCategory: StringEntity.withDefault(),
PinSubCategory: StringEntity.withDefault(),
PinSubCategoryObject: ObjectReferenceEntity.withDefault(),
PinSubCategoryMemberReference: FunctionReferenceEntity.withDefault(),
PinSubCategoryObject: ObjectReferenceEntity,
PinSubCategoryMemberReference: FunctionReferenceEntity,
ContainerType: SymbolEntity,
bIsReference: BooleanEntity.withDefault(),
bIsConst: BooleanEntity.withDefault(),
bIsWeakPointer: BooleanEntity.withDefault(),
bIsUObjectWrapper: BooleanEntity.withDefault(),
bSerializeAsSinglePrecisionFloat: BooleanEntity.withDefault(),
bIsReference: BooleanEntity,
bIsConst: BooleanEntity,
bIsWeakPointer: BooleanEntity,
bIsUObjectWrapper: BooleanEntity,
bSerializeAsSinglePrecisionFloat: BooleanEntity,
}
static grammar = this.createGrammar()
@@ -5617,7 +5617,7 @@ class PinEntity extends IEntity {
bDefaultValueIsReadOnly: BooleanEntity.withDefault(),
bDefaultValueIsIgnored: BooleanEntity.withDefault(),
bAdvancedView: BooleanEntity.withDefault(),
bOrphanedPin: BooleanEntity.withDefault(),
bOrphanedPin: BooleanEntity,
}
static grammar = this.createGrammar()
@@ -5837,7 +5837,7 @@ class PinEntity extends IEntity {
}
getSubCategory() {
return this.PinType.PinSubCategoryObject.path
return this.PinType.PinSubCategoryObject?.path
}
pinColor() {
@@ -6509,7 +6509,7 @@ class ObjectEntity extends IEntity {
getClass() {
if (!this.#class) {
this.#class = (this.Class?.path ? this.Class.path : this.Class?.type)
?? this.ExportPath.type
?? this.ExportPath?.type
?? "";
if (this.#class && !this.#class.startsWith("/")) {
// Old path names did not start with /Script or /Engine, check tests/resources/LegacyNodes.js
@@ -13425,10 +13425,10 @@ function initializeSerializerFactory() {
NumberEntity.grammar,
Parsernostrum.alt(
ObjectReferenceEntity.fullReferenceGrammar,
Parsernostrum.regArray(
Parsernostrum.regArray(new RegExp(
// @ts-expect-error
new RegExp(`"(${Grammar.Regex.Path.source})'(${Grammar.symbol.getParser().regexp.source})'"`)
).map(([full, type, path]) => new ObjectReferenceEntity(type, path, full))
`"(${Grammar.Regex.Path.source})'(${Grammar.Regex.Path.source}|${Grammar.symbol.getParser().regexp.source})'"`
)).map(([full, type, path]) => new ObjectReferenceEntity(type, path, full))
),
StringEntity.grammar,
LocalizedTextEntity.grammar,

File diff suppressed because one or more lines are too long

View File

@@ -414,7 +414,7 @@ export default class ObjectEntity extends IEntity {
getClass() {
if (!this.#class) {
this.#class = (this.Class?.path ? this.Class.path : this.Class?.type)
?? this.ExportPath.type
?? this.ExportPath?.type
?? ""
if (this.#class && !this.#class.startsWith("/")) {
// Old path names did not start with /Script or /Engine, check tests/resources/LegacyNodes.js

View File

@@ -93,7 +93,7 @@ export default class PinEntity extends IEntity {
bDefaultValueIsReadOnly: BooleanEntity.withDefault(),
bDefaultValueIsIgnored: BooleanEntity.withDefault(),
bAdvancedView: BooleanEntity.withDefault(),
bOrphanedPin: BooleanEntity.withDefault(),
bOrphanedPin: BooleanEntity,
}
static grammar = this.createGrammar()
@@ -313,7 +313,7 @@ export default class PinEntity extends IEntity {
}
getSubCategory() {
return this.PinType.PinSubCategoryObject.path
return this.PinType.PinSubCategoryObject?.path
}
pinColor() {

View File

@@ -13,14 +13,14 @@ export default class PinTypeEntity extends IEntity {
...super.attributes,
PinCategory: StringEntity.withDefault(),
PinSubCategory: StringEntity.withDefault(),
PinSubCategoryObject: ObjectReferenceEntity.withDefault(),
PinSubCategoryMemberReference: FunctionReferenceEntity.withDefault(),
PinSubCategoryObject: ObjectReferenceEntity,
PinSubCategoryMemberReference: FunctionReferenceEntity,
ContainerType: SymbolEntity,
bIsReference: BooleanEntity.withDefault(),
bIsConst: BooleanEntity.withDefault(),
bIsWeakPointer: BooleanEntity.withDefault(),
bIsUObjectWrapper: BooleanEntity.withDefault(),
bSerializeAsSinglePrecisionFloat: BooleanEntity.withDefault(),
bIsReference: BooleanEntity,
bIsConst: BooleanEntity,
bIsWeakPointer: BooleanEntity,
bIsUObjectWrapper: BooleanEntity,
bSerializeAsSinglePrecisionFloat: BooleanEntity,
}
static grammar = this.createGrammar()

View File

@@ -32,10 +32,10 @@ export default function initializeSerializerFactory() {
NumberEntity.grammar,
Parsernostrum.alt(
ObjectReferenceEntity.fullReferenceGrammar,
Parsernostrum.regArray(
Parsernostrum.regArray(new RegExp(
// @ts-expect-error
new RegExp(`"(${Grammar.Regex.Path.source})'(${Grammar.symbol.getParser().regexp.source})'"`)
).map(([full, type, path]) => new ObjectReferenceEntity(type, path, full))
`"(${Grammar.Regex.Path.source})'(${Grammar.Regex.Path.source}|${Grammar.symbol.getParser().regexp.source})'"`
)).map(([full, type, path]) => new ObjectReferenceEntity(type, path, full))
),
StringEntity.grammar,
LocalizedTextEntity.grammar,

View File

@@ -1201,6 +1201,9 @@ test("Unknown", () => {
expect(parser.parse(`"/Script/MetasoundEditor.MetasoundEditorGraphVariable'MetasoundEditorGraphVariable_1'"`)).toBeInstanceOf(ObjectReferenceEntity)
expect(parser.parse(`"/Script/MetasoundEditor.MetasoundEditorGraphVariable'MetasoundEditorGraphVariable_1'"`).serialize())
.toEqual(`"/Script/MetasoundEditor.MetasoundEditorGraphVariable'MetasoundEditorGraphVariable_1'"`)
expect(parser.parse(`"/Script/AIModule.BlackboardData'/Game/Enemies/AI/BB_EnemyBase.BB_EnemyBase'"`)).toBeInstanceOf(ObjectReferenceEntity)
expect(parser.parse(`"/Script/AIModule.BlackboardData'/Game/Enemies/AI/BB_EnemyBase.BB_EnemyBase'"`).serialize())
.toEqual(`"/Script/AIModule.BlackboardData'/Game/Enemies/AI/BB_EnemyBase.BB_EnemyBase'"`)
expect(parser.parse("(1,2,3,4,5,6,7,8,9)")).toBeInstanceOf(ArrayEntity)
expect(parser.parse("(1,2,3,4,5,6,7,8,9)").serialize()).toEqual("(1,2,3,4,5,6,7,8,9)")
expect(parser.parse(`("Hello", "World",)`)).toBeInstanceOf(ArrayEntity)