Grammar refactoring WIP

This commit is contained in:
barsdeveloper
2023-03-27 20:30:54 +02:00
parent b235d63348
commit a63893d73b
6 changed files with 946 additions and 930 deletions

937
dist/ueblueprint.js vendored

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -32,6 +32,7 @@ import Utility from "../Utility.js"
export default class IEntity {
static lookbehind = ""
/** @type {AttributeDeclarations} */
static attributes = {}
static defaultAttribute = {

File diff suppressed because it is too large Load Diff

View File

@@ -1,8 +1,8 @@
import Grammar from "./Grammar.js"
import Parsimmon from "parsimmon"
import SerializerFactory from "./SerializerFactory.js"
import Utility from "../Utility.js"
import IEntity from "../entity/IEntity.js"
import Parsimmon from "parsimmon"
/**
* @typedef {import("../entity/IEntity").EntityConstructor} EntityConstructor

View File

@@ -22,7 +22,7 @@ export default class ObjectSerializer extends ISerializer {
/** @param {String} value */
read(value) {
const parseResult = ISerializer.grammar.Object.parse(value)
const parseResult = ISerializer.grammar.objectEntity.parse(value)
if (!parseResult.status) {
throw new Error("Error when trying to parse the object.")
}
@@ -34,7 +34,7 @@ export default class ObjectSerializer extends ISerializer {
* @returns {ObjectEntity[]}
*/
readMultiple(value) {
const parseResult = ISerializer.grammar.MultipleObject.parse(value)
const parseResult = ISerializer.grammar.multipleObject.parse(value)
if (!parseResult.status) {
throw new Error("Error when trying to parse the object.")
}