License | BSD3 |
---|---|
Maintainer | The Idris Community. |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Idris.Parser
Description
Synopsis
- type IdrisParser = Parser IState
- data ImportInfo = ImportInfo {
- import_reexport :: Bool
- import_path :: FilePath
- import_rename :: Maybe (String, FC)
- import_namespace :: [Text]
- import_location :: FC
- import_modname_location :: FC
- moduleName :: Parsing m => m Name
- addReplSyntax :: IState -> Syntax -> IState
- clearParserWarnings :: Idris ()
- decl :: SyntaxInfo -> IdrisParser [PDecl]
- fixColour :: Bool -> Doc -> Doc
- loadFromIFile :: Bool -> IBCPhase -> IFileType -> Maybe Int -> Idris ()
- loadModule :: FilePath -> IBCPhase -> Idris (Maybe String)
- name :: (Parsing m, MonadState IState m) => m Name
- opChars :: String
- parseElabShellStep :: IState -> String -> Either ParseError (Either ElabShellCmd PDo)
- parseConst :: IState -> String -> Either ParseError Const
- parseExpr :: IState -> String -> Either ParseError PTerm
- parseImports :: FilePath -> String -> Idris (Maybe (Docstring ()), [String], [ImportInfo], Maybe Mark)
- parseTactic :: IState -> String -> Either ParseError PTactic
- runparser :: Parser st res -> st -> String -> String -> Either ParseError res
- data ParseError
- parseErrorDoc :: ParseError -> Doc
Documentation
type IdrisParser = Parser IState #
Idris parser with state used during parsing
data ImportInfo #
Constructors
ImportInfo | |
Fields
|
moduleName :: Parsing m => m Name #
Parses module definition
ModuleHeader ::= DocComment_t? 'module' Identifier_t ';'?;
addReplSyntax :: IState -> Syntax -> IState #
Like addSyntax
, but no effect on the IBC.
clearParserWarnings :: Idris () #
decl :: SyntaxInfo -> IdrisParser [PDecl] #
Parses a top-level declaration
Decl ::= Decl' | Using | Params | Mutual | Namespace | Interface | Implementation | DSL | Directive | Provider | Transform | Import! | RunElabDecl ;
fixColour :: Bool -> Doc -> Doc #
Check if the coloring matches the options and corrects if necessary
loadFromIFile :: Bool -> IBCPhase -> IFileType -> Maybe Int -> Idris () #
Load idris code from file
loadModule :: FilePath -> IBCPhase -> Idris (Maybe String) #
Load idris module and show error if something wrong happens
parseElabShellStep :: IState -> String -> Either ParseError (Either ElabShellCmd PDo) #
Parses a do-step from input (used in the elab shell)
parseConst :: IState -> String -> Either ParseError Const #
Parses a constant form input
parseExpr :: IState -> String -> Either ParseError PTerm #
Parses an expression from input
parseImports :: FilePath -> String -> Idris (Maybe (Docstring ()), [String], [ImportInfo], Maybe Mark) #
Parse module header and imports
parseTactic :: IState -> String -> Either ParseError PTactic #
Parses a tactic from input
runparser :: Parser st res -> st -> String -> String -> Either ParseError res #
Run the Idris parser stack
data ParseError #
Instances
Message ParseError # | |
Defined in Idris.Parser.Stack Methods messageExtent :: ParseError -> FC # messageText :: ParseError -> OutputDoc # messageSource :: ParseError -> Maybe String # |
parseErrorDoc :: ParseError -> Doc #