Several fixes

This commit is contained in:
barsdeveloper
2024-02-15 00:09:15 +01:00
parent 67fc3c219b
commit 34a4f2746f
10 changed files with 311 additions and 77 deletions

View File

@@ -53,17 +53,6 @@ export default class Grammar {
static colorValue = Parsernostrum.numberByte
static word = Parsernostrum.reg(Grammar.Regex.Word)
static pathQuotes = Parsernostrum.regArray(new RegExp(
`'"(` + Grammar.Regex.InsideString.source + `)"'`
+ `|'(` + Grammar.Regex.InsideSingleQuotedString.source + `)'`
+ `|"(` + Grammar.Regex.InsideString.source + `)"`
)).map(([_0, a, b, c]) => a ?? b ?? c)
static path = Parsernostrum.regArray(new RegExp(
`'"(` + Grammar.Regex.InsideString.source + `)"'`
+ `|'(` + Grammar.Regex.InsideSingleQuotedString.source + `)'`
+ `|"(` + Grammar.Regex.InsideString.source + `)"`
+ `|(` + Grammar.Regex.Path.source + `)`
)).map(([_0, a, b, c, d]) => a ?? b ?? c ?? d)
static symbol = Parsernostrum.reg(Grammar.Regex.Symbol)
static symbolQuoted = Parsernostrum.reg(new RegExp('"(' + Grammar.Regex.Symbol.source + ')"'), 1)
static attributeName = Parsernostrum.reg(Grammar.Regex.DotSeparatedSymbols)
@@ -72,7 +61,6 @@ export default class Grammar {
static commaSeparation = Parsernostrum.reg(/\s*,\s*(?!\))/)
static commaOrSpaceSeparation = Parsernostrum.reg(/\s*,\s*(?!\))|\s+/)
static equalSeparation = Parsernostrum.reg(/\s*=\s*/)
static typeReference = Parsernostrum.alt(Parsernostrum.reg(Grammar.Regex.Path), this.symbol)
static hexColorChannel = Parsernostrum.reg(new RegExp(Grammar.Regex.HexDigit.source + "{2}"))
/* --- Factory --- */