Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- parsePrintModule :: Config -> Text -> IO (Either [BrittanyError] Text)
- parsePrintModuleTests :: Config -> String -> Text -> IO (Either String Text)
- pPrintModule :: Config -> PerItemConfig -> Anns -> ParsedSource -> ([BrittanyError], Text)
- pPrintModuleAndCheck :: Config -> PerItemConfig -> Anns -> ParsedSource -> IO ([BrittanyError], Text)
- parseModule :: [String] -> FilePath -> (DynFlags -> IO (Either String a)) -> IO (Either String (Anns, ParsedSource, a))
- parseModuleFromString :: [String] -> FilePath -> (DynFlags -> IO (Either String a)) -> String -> IO (Either String (Anns, ParsedSource, a))
- extractCommentConfigs :: Anns -> TopLevelDeclNameMap -> Either (String, String) (CConfig Option, PerItemConfig)
- getTopLevelDeclNameMap :: ParsedSource -> TopLevelDeclNameMap
Documentation
parsePrintModule :: Config -> Text -> IO (Either [BrittanyError] Text) Source #
Exposes the transformation in an pseudo-pure fashion. The signature
contains IO
due to the GHC API not exposing a pure parsing function, but
there should be no observable effects.
Note that this function ignores/resets all config values regarding
debugging, i.e. it will never use trace
/write to stderr.
Note that the ghc parsing function used internally currently is wrapped in
mask_
, so cannot be killed easily. If you don't control the input, you
may wish to put some proper upper bound on the input's size as a timeout
won't do.
pPrintModule :: Config -> PerItemConfig -> Anns -> ParsedSource -> ([BrittanyError], Text) Source #
pPrintModuleAndCheck :: Config -> PerItemConfig -> Anns -> ParsedSource -> IO ([BrittanyError], Text) Source #
Additionally checks that the output compiles again, appending an error if it does not.
parseModule :: [String] -> FilePath -> (DynFlags -> IO (Either String a)) -> IO (Either String (Anns, ParsedSource, a)) Source #
parseModuleFromString :: [String] -> FilePath -> (DynFlags -> IO (Either String a)) -> String -> IO (Either String (Anns, ParsedSource, a)) Source #
extractCommentConfigs :: Anns -> TopLevelDeclNameMap -> Either (String, String) (CConfig Option, PerItemConfig) Source #