Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Utils for various parsers (beyond token level).
We can sometimes work around there being free-form and fixed-form versions of
the LexAction
monad by requesting the underlying instances instances. We place
such utilities that match that form here.
Synopsis
- exprToComplexLitPart :: MonadFail m => Expression a -> m (ComplexPart a)
- complexLit :: MonadFail m => SrcSpan -> Expression A0 -> Expression A0 -> m (Expression A0)
Documentation
Parsing complex literal parts unambiguously is a pain, so instead, we parse any
expression, then case on it to determine if it's valid for a complex literal
part -- and if so, push it into a ComplexPart
constructor. This may cause
unexpected behaviour if more bracketing/tuple rules are added!
exprToComplexLitPart :: MonadFail m => Expression a -> m (ComplexPart a) Source #
complexLit :: MonadFail m => SrcSpan -> Expression A0 -> Expression A0 -> m (Expression A0) Source #
Helper for forming COMPLEX literals.