space :: MonadParsec e s m=> m ()A parser for space characters which does not accept empty input (e.g. space1)
-> m ()A parser for a line comment (e.g.
skipLineComment)-> m ()A parser for a block comment (e.g.
skipBlockComment)-> m ()
space sc lineComment blockComment produces a parser that can parse
white space in general. It's expected that you create such a parser once
and pass it to other functions in this module as needed (when you see
spaceConsumer in documentation, usually it means that something like
space is expected there).
sc is used to parse blocks of space characters. You can use
space1 from Text.Megaparsec.Char for this
purpose as well as your own parser (if you don't want to automatically
consume newlines, for example). Make sure that the parser does not
succeed on the empty input though. In an earlier version of the library
spaceChar was recommended, but now parsers based
on takeWhile1P are preferred because of their speed.
lineComment is used to parse line comments. You can use
skipLineComment if you don't need anything special.
blockComment is used to parse block (multi-line) comments. You can use
skipBlockComment or skipBlockCommentNested if you don't need anything
special.
If you don't want to allow a kind of comment, simply pass empty which will fail instantly when parsing of that sort of comment is attempted and space will just move on or finish depending on whether there is more white space for it to consume.