mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-03-05 23:27:31 +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 {
|
export default class IEntity {
|
||||||
|
|
||||||
|
static lookbehind = ""
|
||||||
/** @type {AttributeDeclarations} */
|
/** @type {AttributeDeclarations} */
|
||||||
static attributes = {}
|
static attributes = {}
|
||||||
static defaultAttribute = {
|
static defaultAttribute = {
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,8 +1,8 @@
|
|||||||
import Grammar from "./Grammar.js"
|
import Grammar from "./Grammar.js"
|
||||||
import Parsimmon from "parsimmon"
|
|
||||||
import SerializerFactory from "./SerializerFactory.js"
|
import SerializerFactory from "./SerializerFactory.js"
|
||||||
import Utility from "../Utility.js"
|
import Utility from "../Utility.js"
|
||||||
import IEntity from "../entity/IEntity.js"
|
import IEntity from "../entity/IEntity.js"
|
||||||
|
import Parsimmon from "parsimmon"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {import("../entity/IEntity").EntityConstructor} EntityConstructor
|
* @typedef {import("../entity/IEntity").EntityConstructor} EntityConstructor
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ export default class ObjectSerializer extends ISerializer {
|
|||||||
|
|
||||||
/** @param {String} value */
|
/** @param {String} value */
|
||||||
read(value) {
|
read(value) {
|
||||||
const parseResult = ISerializer.grammar.Object.parse(value)
|
const parseResult = ISerializer.grammar.objectEntity.parse(value)
|
||||||
if (!parseResult.status) {
|
if (!parseResult.status) {
|
||||||
throw new Error("Error when trying to parse the object.")
|
throw new Error("Error when trying to parse the object.")
|
||||||
}
|
}
|
||||||
@@ -34,7 +34,7 @@ export default class ObjectSerializer extends ISerializer {
|
|||||||
* @returns {ObjectEntity[]}
|
* @returns {ObjectEntity[]}
|
||||||
*/
|
*/
|
||||||
readMultiple(value) {
|
readMultiple(value) {
|
||||||
const parseResult = ISerializer.grammar.MultipleObject.parse(value)
|
const parseResult = ISerializer.grammar.multipleObject.parse(value)
|
||||||
if (!parseResult.status) {
|
if (!parseResult.status) {
|
||||||
throw new Error("Error when trying to parse the object.")
|
throw new Error("Error when trying to parse the object.")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user