mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-04 08:50:33 +08:00
Grammar refactoring WIP
This commit is contained in:
937
dist/ueblueprint.js
vendored
937
dist/ueblueprint.js
vendored
File diff suppressed because it is too large
Load Diff
8
dist/ueblueprint.min.js
vendored
8
dist/ueblueprint.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -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
@@ -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
|
||||
|
||||
@@ -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.")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user