3
votes

I am using parsing combinators in scala If I have recursive parser:

val uninterestingthings = ".".r

val parser = "(?ui)(regexvalue)".r | (uninterestingthings~>parser)

How can I check how many characters of input my parser consumed?

1
Doesn't look recursive to me. Is it a typo? (s/parser2/parser/) - Mitch Blevins
Sorry, made a mistake. Now it looks. - Jeriho

1 Answers

2
votes

There is a positioned combinator that (to quote its documentation) "decorates a parser's result with the start position of the input it consumed."