Entities semplification

* Entities semplification WIP

* Bug fixes after entity semplification

* Fix object serialization
This commit is contained in:
barsdeveloper
2023-05-05 18:50:31 +02:00
committed by GitHub
parent 4eb1ff2a7c
commit 90f19e1bca
26 changed files with 181 additions and 391 deletions

View File

@@ -175,6 +175,7 @@ export default class Grammar {
)
} else if (type instanceof MirroredEntity) {
return this.grammarFor(type.type.attributes[type.key])
.map(() => new MirroredEntity(type.type, type.key, type.getter))
} else if (attribute?.constructor === Object) {
result = this.grammarFor(undefined, type)
} else {
@@ -454,9 +455,7 @@ export default class Grammar {
static naturalNumberEntity = P.lazy(() => this.naturalNumber.map(v => new NaturalNumberEntity(v)))
static noneReferenceEntity = P.lazy(() =>
P.string("None").map(() =>
new ObjectReferenceEntity({ type: "None", path: "" })
)
P.string("None").map(() => ObjectReferenceEntity.createNoneInstance())
)
static typeReferenceEntity = P.lazy(() =>