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