Extract Operator? #317
Closed
jessegrosjean
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
Hey @jessegrosjean, this sounds like it might be the Consumed parser. Your implementation above looks pretty similar. swift-parsing/Sources/Parsing/ParserPrinters/Consumed.swift Lines 16 to 20 in a0e7d73 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Maybe this is already possible with existing operators, but I couldn't figure it out...
Extract allows you to run a parser, but discard that parser's output and instead return the Input.Subsequence that was consumed.
I'm using it to parse "unquoted text" in a query language that I'm working on. Unquoted text means you that instead of typing
"My query"
you can instead typeMy query
(without quotes) as long as the text doesn't contain any keywords or other query syntax characters. I use it like this:Beta Was this translation helpful? Give feedback.
All reactions