Jeriho
Jeriho

Reputation: 7299

Parser combinators info

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?

Upvotes: 3

Views: 278

Answers (1)

Randall Schulz
Randall Schulz

Reputation: 26486

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

Upvotes: 2

Related Questions