Add plus function

This commit is contained in:
Florian Schroedl
2022-08-26 18:47:32 +02:00
parent 23b05f2366
commit ffb2a08055

View File

@@ -348,8 +348,7 @@ when isMainModule:
let testSentenceStr = "This is a sentence\n\nFollowing another sentence."
let testSentenceParser = initParserResult(testSentenceStr)
let testSentence1 = following(@[anyUntil(newline), newline, newlineOrEol ]) +
manyUntil(choice(@[letter, whitespace]), ch('.')) + ch('.') +
newlineOrEol
let testSentence1 = following(@[anyUntil(newline), newline, newlineOrEol])
.plus(manyUntil(choice(@[letter, whitespace]), ch('.')) + ch('.') + newlineOrEol)
assert testSentenceParser.flatMap(testSentence1).tokensToString() == testSentenceStr