-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Hi, nice library, I especially like the syntax.
Is there any way of parsing only one match per position? Now when I run code like this:
let myany = LazilyRepeating(one() as Wildcard<String>)
let token = Token("." • myany • Literal(" ") • myany • " ")
let parser = myany • token
parser.forwardMatches(enteringFrom: Match<String>(over: #" .1 slkjdf.2 .3 "#)).forEach {
print($0.captures(for: token))
}
it seems to find all possible matches for each position:
[".1 "]
[".1 slkjdf.2 "]
[".1 slkjdf.2 .3 "]
[".1 slkjdf.2 .3 "]
[".1 slkjdf.2 "]
[".1 slkjdf.2 .3 "]
[".1 slkjdf.2 .3 "]
[".1 slkjdf.2 .3 "]
[".1 slkjdf.2 .3 "]
[".1 slkjdf.2 .3 "]
[".2 .3 "]
[".2 .3 "]
[".2 .3 "]
[".3 "]
How do I tell LazilyRepeating
to only find the shortest possible match?
Metadata
Metadata
Assignees
Labels
No labels