开发者

Get match length in parsec

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜