Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
TH stage restriction guff for flatparsing
Synopsis
- ws :: Parser e ()
- token :: Parser e a -> Parser e a
- lineComment :: Parser e ()
- multilineComment :: Parser e ()
- htmlLike :: Parser e String
- isValidStartChar :: Char -> Bool
- isValidChar :: Char -> Bool
- identStartChar :: Parser e Char
- identChar :: Parser e Char
- symbol :: String -> Q Exp
- keyword :: String -> Q Exp
- symbol' :: String -> Q Exp
- keyword' :: String -> Q Exp
- ident :: Parser e ByteString
- ident' :: Parser Error ByteString
- data Error
- errorPos :: Error -> Pos
- merge :: Error -> Error -> Error
- prettyError :: ByteString -> Error -> ByteString
- cut :: Parser Error a -> [ByteString] -> Parser Error a
- cut' :: Parser Error a -> ByteString -> Parser Error a
Documentation
lineComment :: Parser e () Source #
Parse a line comment.
multilineComment :: Parser e () Source #
Parse a potentially nested multiline comment.
isValidStartChar :: Char -> Bool Source #
First character of a dot identifier.
isValidChar :: Char -> Bool Source #
character of a dot identifier.
identStartChar :: Parser e Char Source #
Read a starting character of an identifier.
ident :: Parser e ByteString Source #
Parse an identifier.
A parsing error.
Precise Pos ByteString | A precisely known error, like leaving out "in" from "let". |
Imprecise Pos [ByteString] | An imprecise error, when we expect a number of different things, but parse something else. |
merge :: Error -> Error -> Error Source #
Merge two errors. Inner errors (which were thrown at points with more consumed inputs) are preferred. If errors are thrown at identical input positions, we prefer precise errors to imprecise ones.
The point of prioritizing inner and precise errors is to suppress the deluge of "expected" items, and instead try to point to a concrete issue to fix.
prettyError :: ByteString -> Error -> ByteString Source #
Pretty print an error. The ByteString
input is the source file. The offending line from the
source is displayed in the output.