Add parser result initialiser

This commit is contained in:
Florian Schroedl
2022-01-20 17:00:00 +01:00
parent 20712cef95
commit 905fd06348

View File

@@ -109,6 +109,9 @@ proc initParser*(str: string): Parser =
tokens: newSeq[Token](),
)
proc initParserResult*(str: string): ParserResult =
ParserResult.ok(initParser(str))
func ch*(expectedChars: set[char]): (Parser -> ParserResult) {.inline.} =
return func(parser: Parser): ParserResult =
let state = parser.state