In Parsec, is there a way to prevent lexeme from consuming newlines?

前端 未结 4 1984
生来不讨喜
生来不讨喜 2021-02-13 12:36

All of the parsers in Text.Parsec.Token politely use lexeme to eat whitespace after a token. Unfortunately for me, whitespace includes new lines, whic

4条回答
  •  不思量自难忘°
    2021-02-13 12:58

    If newlines are your expression terminators, maybe it would make sense to split the input at each newline and parsing each line on its own.

提交回复
热议问题