| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Cubix.ParsePretty
Synopsis
- class ParseFile (fs :: Signature) where
- class ParseFile fs => ParseFileTrackSources (fs :: Signature) where
- parseFileTrackSources :: FilePath -> IO (Maybe (AnnTerm (Maybe SourceSpan) fs (RootSort fs)))
- class Pretty (fs :: Signature) where
- parseLua :: FilePath -> IO (Maybe (MLuaTerm LBlockL))
- prettyLua :: MLuaTerm LBlockL -> String
- type family RootSort (fs :: [(Type -> Type) -> Type -> Type])
- parseC :: FilePath -> IO (Maybe (MCTerm CTranslationUnitL))
- parseJava :: FilePath -> IO (Maybe (MJavaTerm CompilationUnitL))
- parseJavaScript :: FilePath -> IO (Maybe (MJSTerm JSASTL))
- parsePython :: FilePath -> IO (Maybe (MPythonTermAnn (Maybe SourceSpan) ModuleL))
- prettyC :: MCTerm CTranslationUnitL -> String
- prettyJava :: MJavaTerm CompilationUnitL -> String
- prettyJavaScript :: MJSTerm JSASTL -> String
- prettyPython :: MPythonTerm ModuleL -> String
Documentation
class ParseFile (fs :: Signature) where Source #
Methods
parseFile :: FilePath -> IO (Maybe (Term fs (RootSort fs))) Source #
Parses a file with the appropriate parser for the language with signature fs.
Recommended to use with the TypeApplications extension,
e.g.: parseFile @MCSig "my_file.c".
class ParseFile fs => ParseFileTrackSources (fs :: Signature) where Source #
Methods
parseFileTrackSources :: FilePath -> IO (Maybe (AnnTerm (Maybe SourceSpan) fs (RootSort fs))) Source #
Parses a file with the appropriate parser for the language with signature fs,
tracking source positions of many nodes. (Which depends on the language frontend)
Recommended to use with the TypeApplications extension,
e.g.: parseFileTrackSources @MCSig "my_file.c".
Instances
| ParseFileTrackSources MPythonSig Source # | |
Defined in Cubix.ParsePretty Methods parseFileTrackSources :: FilePath -> IO (Maybe (AnnTerm (Maybe SourceSpan) MPythonSig (RootSort MPythonSig))) Source # | |
class Pretty (fs :: Signature) where Source #
Minimal complete definition
Methods
pretty :: Term fs (RootSort fs) -> String Source #
Pretty-prints a term, using the appropriate pretty-printer for the language with
signature fs.
prettyUnsafe :: Term fs l -> String Source #
parseLua :: FilePath -> IO (Maybe (MLuaTerm LBlockL)) Source #
NOTE: This reflects the half-finished transition of Lua to annotated terms
type family RootSort (fs :: [(Type -> Type) -> Type -> Type]) Source #
Instances
| type RootSort MCSig Source # | |
Defined in Cubix.ParsePretty | |
| type RootSort MJavaSig Source # | |
Defined in Cubix.ParsePretty | |
| type RootSort MJSSig Source # | |
Defined in Cubix.ParsePretty | |
| type RootSort MLuaSig Source # | |
Defined in Cubix.ParsePretty | |
| type RootSort MPythonSig Source # | |
Defined in Cubix.ParsePretty | |
parsePython :: FilePath -> IO (Maybe (MPythonTermAnn (Maybe SourceSpan) ModuleL)) Source #
prettyPython :: MPythonTerm ModuleL -> String Source #