fortran-src-0.10.2: Parsers and analyses for Fortran standards 66, 77, 90, 95 and 2003 (partial).
Safe HaskellSafe-Inferred
LanguageHaskell2010

Language.Fortran.Parser.ParserUtils

Description

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

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!

 

complexLit :: MonadFail m => SrcSpan -> Expression A0 -> Expression A0 -> m (Expression A0) Source #

Helper for forming COMPLEX literals.