Restore delimiter parsers

This commit is contained in:
Florian Schroedl
2022-08-27 15:53:41 +02:00
parent 67e5a44d49
commit 19d2cae392
4 changed files with 354 additions and 0 deletions

View File

@@ -143,6 +143,9 @@ func tokensToString*(parserResult: ParserResult, fallback = ""): string =
xs => xs.toString(),
)
func tokensToString*(tokens: seq[ParserToken]): string =
tokens.foldl(a & b.toString(), "")
func setErrorExpectedField*(err: ParserError, expected: string): ParserError =
ParserError(
kind: err.kind,
@@ -329,3 +332,4 @@ when isMainModule:
# tokensToString
assert testTokensSeqParserResult.tokensToString() == testExpectedStr
assert testTokensSeq.tokensToString() == testExpectedStr