mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-03 23:55:04 +08:00
Input refactoring (#12)
* Fix folder name typo * Smaller fixes * Shortcut rename to Shortcuts * Fix quoted attributes in UE 5.3 * remove KeyboardShortcutAction * Remove more trivial classes * Rename IKeyboardShortcut * Node delete shortcut
This commit is contained in:
@@ -129,6 +129,13 @@ export default class Grammar {
|
||||
)
|
||||
static symbol = P.regex(Grammar.Regex.Symbol)
|
||||
static attributeName = P.regex(Grammar.Regex.DotSeparatedSymbols)
|
||||
static attributeNameOptQuotes = Grammar.regexMap(
|
||||
new RegExp(
|
||||
"(" + Grammar.Regex.DotSeparatedSymbols.source + ")"
|
||||
+ '|"' + "(" + Grammar.Regex.DotSeparatedSymbols.source + ")" + '"'
|
||||
),
|
||||
([_0, a, b]) => a ?? b
|
||||
)
|
||||
static guid = P.regex(new RegExp(`${Grammar.Regex.HexDigit.source}{32}`))
|
||||
static commaSeparation = P.regex(/\s*,\s*(?!\))/)
|
||||
static equalSeparation = P.regex(/\s*=\s*/)
|
||||
@@ -338,9 +345,9 @@ export default class Grammar {
|
||||
return result
|
||||
}
|
||||
|
||||
static createAttributeGrammar(entityType, valueSeparator = this.equalSeparation) {
|
||||
static createAttributeGrammar(entityType, attributeName = this.attributeName, valueSeparator = this.equalSeparation) {
|
||||
return P.seq(
|
||||
this.attributeName,
|
||||
attributeName,
|
||||
valueSeparator,
|
||||
).chain(([attributeName, _1]) => {
|
||||
const attributeKey = attributeName.split(Configuration.keysSeparator)
|
||||
@@ -698,7 +705,7 @@ export default class Grammar {
|
||||
P.whitespace,
|
||||
P.alt(
|
||||
this.customProperty,
|
||||
this.createAttributeGrammar(ObjectEntity),
|
||||
this.createAttributeGrammar(ObjectEntity, this.attributeNameOptQuotes),
|
||||
this.inlinedArrayEntry,
|
||||
this.subObjectEntity
|
||||
)
|
||||
|
||||
@@ -144,7 +144,7 @@ export default function initializeSerializerFactory() {
|
||||
|
||||
SerializerFactory.registerSerializer(
|
||||
InvariantTextEntity,
|
||||
new Serializer(InvariantTextEntity, (entity, v) => `${InvariantTextEntity.lookbehind}(${v})`, ", ", false, "", _ => "")
|
||||
new Serializer(InvariantTextEntity, (entity, v) => `${InvariantTextEntity.lookbehind}(${v})`, ", ", false, "", () => "")
|
||||
)
|
||||
|
||||
SerializerFactory.registerSerializer(
|
||||
@@ -159,7 +159,7 @@ export default function initializeSerializerFactory() {
|
||||
|
||||
SerializerFactory.registerSerializer(
|
||||
LocalizedTextEntity,
|
||||
new Serializer(LocalizedTextEntity, (entity, v) => `${LocalizedTextEntity.lookbehind}(${v})`, ", ", false, "", _ => "")
|
||||
new Serializer(LocalizedTextEntity, (entity, v) => `${LocalizedTextEntity.lookbehind}(${v})`, ", ", false, "", () => "")
|
||||
)
|
||||
|
||||
SerializerFactory.registerSerializer(
|
||||
@@ -209,7 +209,7 @@ export default function initializeSerializerFactory() {
|
||||
|
||||
SerializerFactory.registerSerializer(
|
||||
PinReferenceEntity,
|
||||
new Serializer(PinReferenceEntity, undefined, " ", false, "", _ => "")
|
||||
new Serializer(PinReferenceEntity, undefined, " ", false, "", () => "")
|
||||
)
|
||||
|
||||
SerializerFactory.registerSerializer(
|
||||
|
||||
Reference in New Issue
Block a user