Symbol escaping
This commit is contained in:
parent
9f8321a748
commit
99a1cd4d15
|
@ -1,6 +1,6 @@
|
|||
# Package
|
||||
|
||||
version = "20221102"
|
||||
version = "20221106"
|
||||
author = "Emery Hemingway"
|
||||
description = "data model and serialization format"
|
||||
license = "Unlicense"
|
||||
|
|
|
@ -52,7 +52,7 @@ grammar "Preserves":
|
|||
binunescaped <- {' '..'!', '#'..'[', ']'..'~'}
|
||||
base64char <- {'A'..'Z', 'a'..'z', '0'..'9', '+', '/', '-', '_', '='}
|
||||
|
||||
Symbol <- (symstart * *symcont) | ('|' * *symchar * '|')
|
||||
Symbol <- >(symstart * *symcont) | ('|' * >(*symchar) * '|')
|
||||
|
||||
symstart <- Alpha | sympunct | symustart
|
||||
symcont <- Alpha | sympunct | symustart | symucont | Digit | '-'
|
||||
|
|
|
@ -159,7 +159,7 @@ proc parsePreserves*(text: string): Preserve[void] {.gcsafe.} =
|
|||
pushStack Value(kind: pkByteString, bytes: cast[seq[byte]](base64.decode(joinWhitespace($1))))
|
||||
|
||||
Preserves.Symbol <- Preserves.Symbol:
|
||||
pushStack Value(kind: pkSymbol, symbol: Symbol $0)
|
||||
pushStack Value(kind: pkSymbol, symbol: Symbol $1)
|
||||
|
||||
Preserves.Embedded <- Preserves.Embedded:
|
||||
var v = stack.pop.value
|
||||
|
|
|
@ -272,7 +272,8 @@ const parser = peg("Schema", p: ParseState):
|
|||
Preserves.String |
|
||||
Preserves.ByteString
|
||||
|
||||
Value <- Preserves.Value
|
||||
Value <- Preserves.Value:
|
||||
discard
|
||||
|
||||
editorCruft <- '@' * @'\n'
|
||||
|
||||
|
|
Loading…
Reference in New Issue