License | BSD3 |
---|---|
Maintainer | The Idris Community. |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- module Idris.Parser.Stack
- type IdrisParser = Parser IState
- parseErrorDoc :: ParseError -> Doc
- whiteSpace :: Parsing m => m ()
- someSpace :: Parsing m => m ()
- eol :: Parsing m => m ()
- isEol :: Char -> Bool
- char :: Parsing m => Char -> m Char
- symbol :: Parsing m => String -> m ()
- string :: Parsing m => String -> m String
- lookAheadMatches :: Parsing m => m a -> m Bool
- lchar :: Parsing m => Char -> m Char
- reserved :: Parsing m => String -> m ()
- docComment :: IdrisParser (Docstring (), [(Name, Docstring ())])
- token :: Parsing m => m a -> m a
- natural :: Parsing m => m Integer
- charLiteral :: Parsing m => m Char
- stringLiteral :: Parsing m => m String
- float :: Parsing m => m Double
- bindList :: (RigCount -> Name -> FC -> PTerm -> PTerm -> PTerm) -> [(RigCount, Name, FC, PTerm)] -> PTerm -> PTerm
- maybeWithNS :: Parsing m => m String -> [String] -> m Name
- iName :: Parsing m => [String] -> m Name
- name :: (Parsing m, MonadState IState m) => m Name
- identifier :: Parsing m => m String
- packageName :: Parsing m => m String
- accessibility :: IdrisParser Accessibility
- accData :: Accessibility -> Name -> [Name] -> IdrisParser ()
- addAcc :: Name -> Accessibility -> IdrisParser ()
- fixErrorMsg :: String -> [String] -> String
- parserWarning :: FC -> Maybe Opt -> Err -> IdrisParser ()
- clearParserWarnings :: Idris ()
- reportParserWarnings :: Idris ()
- highlight :: (MonadState IState m, Parsing m) => OutputAnnotation -> m a -> m a
- keyword :: (Parsing m, MonadState IState m) => String -> m ()
- pushIndent :: IdrisParser ()
- popIndent :: IdrisParser ()
- indentGt :: (Parsing m, MonadState IState m) => m ()
- notOpenBraces :: IdrisParser ()
- openBlock :: IdrisParser ()
- closeBlock :: IdrisParser ()
- terminator :: IdrisParser ()
- notEndBlock :: IdrisParser ()
- indentedBlock :: IdrisParser a -> IdrisParser [a]
- indentedBlock1 :: IdrisParser a -> IdrisParser [a]
- indentedBlockS :: IdrisParser a -> IdrisParser a
- indented :: IdrisParser a -> IdrisParser a
- notEndApp :: IdrisParser ()
- commaSeparated :: Parsing m => m a -> m [a]
Documentation
module Idris.Parser.Stack
The parser
type IdrisParser = Parser IState Source #
Idris parser with state used during parsing
parseErrorDoc :: ParseError -> Doc Source #
Space
whiteSpace :: Parsing m => m () Source #
Parses some white space
Basic parsers
lookAheadMatches :: Parsing m => m a -> m Bool Source #
Checks if the following character matches provided parser
Terminals
docComment :: IdrisParser (Docstring (), [(Name, Docstring ())]) Source #
Parses a documentation comment
DocComment_t ::= |||
~EOL_t* EOL_t
;
charLiteral :: Parsing m => m Char Source #
Parses a char literal
stringLiteral :: Parsing m => m String Source #
Parses a string literal
Names
bindList :: (RigCount -> Name -> FC -> PTerm -> PTerm -> PTerm) -> [(RigCount, Name, FC, PTerm)] -> PTerm -> PTerm Source #
Bind constraints to term
maybeWithNS :: Parsing m => m String -> [String] -> m Name Source #
Parses an string possibly prefixed by a namespace
iName :: Parsing m => [String] -> m Name Source #
Parses an identifier with possible namespace as a name
identifier :: Parsing m => m String Source #
Parses an identifier as a token
packageName :: Parsing m => m String Source #
Parse a package name
Access
accData :: Accessibility -> Name -> [Name] -> IdrisParser () Source #
Add accessbility option for data declarations
(works for interfaces too - abstract
means the data/interface is visible but members not)
addAcc :: Name -> Accessibility -> IdrisParser () Source #
Adds accessibility option for function
Warnings and errors
parserWarning :: FC -> Maybe Opt -> Err -> IdrisParser () Source #
clearParserWarnings :: Idris () Source #
reportParserWarnings :: Idris () Source #
Highlighting
highlight :: (MonadState IState m, Parsing m) => OutputAnnotation -> m a -> m a Source #
keyword :: (Parsing m, MonadState IState m) => String -> m () Source #
Parse a reserved identfier, highlighting it as a keyword
Indentation
pushIndent :: IdrisParser () Source #
Push indentation to stack
popIndent :: IdrisParser () Source #
Pops indentation from stack
notOpenBraces :: IdrisParser () Source #
Checks that there are no braces that are not closed
Indented blocks
openBlock :: IdrisParser () Source #
Parses a start of block
closeBlock :: IdrisParser () Source #
Parses an end of block
terminator :: IdrisParser () Source #
Parses a terminator
notEndBlock :: IdrisParser () Source #
Checks that it is not end of block
indentedBlock :: IdrisParser a -> IdrisParser [a] Source #
Applies parser to get a block (which has possibly indented statements)
indentedBlock1 :: IdrisParser a -> IdrisParser [a] Source #
Applies parser to get a block with at least one statement (which has possibly indented statements)
indentedBlockS :: IdrisParser a -> IdrisParser a Source #
Applies parser to get a block with exactly one (possibly indented) statement
indented :: IdrisParser a -> IdrisParser a Source #
Applies parser in an indented position
Miscellaneous
notEndApp :: IdrisParser () Source #
Checks if application expression does not end
commaSeparated :: Parsing m => m a -> m [a] Source #
commaSeparated p
parses one or more occurences of p
,
separated by commas and optional whitespace.