开发者

Get match length in parsec

开发者 https://www.devze.com 2023-03-22 12:07 出处:网络
P开发者_开发百科arsec\'s parse pattern \"(some_input)\" input returns the parsed data (as I specified in pattern.

P开发者_开发百科arsec's parse pattern "(some_input)" input returns the parsed data (as I specified in pattern.

How to know how much of input have it consumed (the pattern is not anchored with eof)? I don't want to add length tracking though the all pattern's internals (if discards some parts of input).


  1. It is not easy with Parsec;
  2. If it is needed to skip header you can grab the rest of input using getInput;
  3. May be other parser libraries can do this.

(the answer is based on comments to the question)

0

精彩评论

暂无评论...
验证码 换一张
取 消