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:
barsdeveloper
2023-08-11 02:48:50 +02:00
committed by GitHub
parent 2284789e6e
commit ed43ee3edd
29 changed files with 652 additions and 485 deletions

View File

@@ -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
)

View File

@@ -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(