mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-19 04:55:57 +08:00
Replace parsing and test libraries
* WIP * WIP * wip * WIP * Several fixes * Tests wip port to playwright * WIP * Fix more tests * Serialization tests fixed * Several fixes for tests * Input options types * Type adjustments * Fix object reference parser * Tests fixes * More tests fixes
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import Configuration from "../Configuration.js"
|
||||
import Grammar from "../serialization/Grammar.js"
|
||||
import IEntity from "./IEntity.js"
|
||||
import Parsimmon from "parsimmon"
|
||||
import Parsernostrum from "parsernostrum"
|
||||
import Utility from "../Utility.js"
|
||||
|
||||
export default class ObjectReferenceEntity extends IEntity {
|
||||
@@ -18,25 +18,18 @@ export default class ObjectReferenceEntity extends IEntity {
|
||||
static {
|
||||
this.cleanupAttributes(this.attributes)
|
||||
}
|
||||
static noneReferenceGrammar = Parsimmon.string("None").map(() => this.createNoneInstance())
|
||||
static fullReferenceGrammar = Parsimmon.seq(
|
||||
static noneReferenceGrammar = Parsernostrum.str("None").map(() => this.createNoneInstance())
|
||||
static fullReferenceGrammar = Parsernostrum.seq(
|
||||
Grammar.typeReference,
|
||||
Parsimmon.regex(Grammar.Regex.InlineOptWhitespace),
|
||||
Parsernostrum.whitespaceInlineOpt,
|
||||
Grammar.pathQuotes
|
||||
)
|
||||
.map(([type, _2, path]) =>
|
||||
new this({ type: type, path: path })
|
||||
)
|
||||
static typeReferenceGrammar = Grammar.typeReference.map(v =>
|
||||
new this({ type: v, path: "" })
|
||||
)
|
||||
static pathReferenceGrammar = Grammar.path.map(path =>
|
||||
new this({ type: "", path: path })
|
||||
)
|
||||
).map(([type, _2, path]) => new this({ type, path }))
|
||||
static typeReferenceGrammar = Grammar.typeReference.map(v => new this({ type: v, path: "" }))
|
||||
static pathReferenceGrammar = Grammar.path.map(path => new this({ type: "", path: path }))
|
||||
static grammar = this.createGrammar()
|
||||
|
||||
static createGrammar() {
|
||||
return Parsimmon.alt(
|
||||
return Parsernostrum.alt(
|
||||
this.noneReferenceGrammar,
|
||||
this.fullReferenceGrammar,
|
||||
this.typeReferenceGrammar,
|
||||
|
||||
Reference in New Issue
Block a user