mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-03-12 11:07:40 +08:00
Integer => IntegerEntity, No more primitive
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import FunctionReferenceEntity from "../entity/FunctionReferenceEntity"
|
||||
import GuidEntity from "../entity/GuidEntity"
|
||||
import Integer from "../entity/primitive/Integer"
|
||||
import IntegerEntity from "../entity/IntegerEntity"
|
||||
import LocalizedTextEntity from "../entity/LocalizedTextEntity"
|
||||
import ObjectEntity from "../entity/ObjectEntity"
|
||||
import ObjectReferenceEntity from "../entity/ObjectReferenceEntity"
|
||||
@@ -21,7 +21,7 @@ export default class Grammar {
|
||||
None = _ => P.string("None").map(_ => new ObjectReferenceEntity({ type: "None", path: "" })).desc("none")
|
||||
Boolean = _ => P.alt(P.string("True"), P.string("False")).map(v => v === "True" ? true : false).desc("either True or False")
|
||||
Number = _ => P.regex(/[0-9]+(?:\.[0-9]+)?/).map(Number).desc("a number")
|
||||
Integer = _ => P.regex(/[0-9]+/).map(v => new Integer(v)).desc("an integer")
|
||||
Integer = _ => P.regex(/[0-9]+/).map(v => new IntegerEntity({ value: v })).desc("an integer")
|
||||
String = _ => P.regex(/(?:[^"\\]|\\")*/).wrap(P.string('"'), P.string('"')).desc('string (with possibility to escape the quote using \")')
|
||||
Word = _ => P.regex(/[a-zA-Z]+/).desc("a word")
|
||||
Guid = _ => P.regex(/[0-9a-zA-Z]{32}/).map(v => new GuidEntity({ value: v })).desc("32 digit hexadecimal (accepts all the letters for safety) value")
|
||||
@@ -76,7 +76,7 @@ export default class Grammar {
|
||||
return r.Boolean
|
||||
case Number:
|
||||
return r.Number
|
||||
case Integer:
|
||||
case IntegerEntity:
|
||||
return r.Integer
|
||||
case String:
|
||||
return r.String
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import Entity from "../entity/Entity"
|
||||
import Grammar from "./Grammar"
|
||||
import Parsimmon from "parsimmon"
|
||||
import Primitive from "../entity/primitive/Primitive"
|
||||
import SerializerFactory from "./SerializerFactory"
|
||||
import TypeInitialization from "../entity/TypeInitialization"
|
||||
import Utility from "../Utility"
|
||||
@@ -41,9 +40,6 @@ export default class Serializer {
|
||||
if (value instanceof Entity) {
|
||||
return serialize(value)
|
||||
}
|
||||
if (value instanceof Primitive) {
|
||||
return value.toString()
|
||||
}
|
||||
}
|
||||
|
||||
subWrite(key, object) {
|
||||
|
||||
Reference in New Issue
Block a user