Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Interface to the Futhark parser.
Synopsis
- parseFuthark :: FilePath -> Text -> Either ParseError UncheckedProg
- parseExp :: FilePath -> Text -> Either ParseError UncheckedExp
- parseModExp :: FilePath -> Text -> Either ParseError (ModExpBase NoInfo Name)
- parseType :: FilePath -> Text -> Either ParseError UncheckedTypeExp
- parseValue :: FilePath -> Text -> Either ParseError Value
- parseValues :: FilePath -> Text -> Either ParseError [Value]
- parseDecOrExpIncrM :: Monad m => m Text -> FilePath -> Text -> m (Either ParseError (Either UncheckedDec UncheckedExp))
- data ParseError = ParseError String
- scanTokensText :: Pos -> Text -> Either String ([L Token], Pos)
- data L a = L SrcLoc a
- data Token
- = ID Name
- | INDEXING Name
- | QUALINDEXING [Name] Name
- | QUALPAREN [Name] Name
- | SYMBOL BinOp [Name] Name
- | CONSTRUCTOR Name
- | PROJ_INTFIELD Name
- | INTLIT Integer
- | STRINGLIT Text
- | I8LIT Int8
- | I16LIT Int16
- | I32LIT Int32
- | I64LIT Int64
- | U8LIT Word8
- | U16LIT Word16
- | U32LIT Word32
- | U64LIT Word64
- | FLOATLIT Double
- | F16LIT Half
- | F32LIT Float
- | F64LIT Double
- | CHARLIT Char
- | COLON
- | COLON_GT
- | BACKSLASH
- | APOSTROPHE
- | APOSTROPHE_THEN_HAT
- | APOSTROPHE_THEN_TILDE
- | BACKTICK
- | HASH_LBRACKET
- | DOT
- | TWO_DOTS
- | TWO_DOTS_LT
- | TWO_DOTS_GT
- | THREE_DOTS
- | LPAR
- | RPAR
- | RPAR_THEN_LBRACKET
- | LBRACKET
- | RBRACKET
- | LCURLY
- | RCURLY
- | COMMA
- | UNDERSCORE
- | RIGHT_ARROW
- | QUESTION_MARK
- | EQU
- | ASTERISK
- | NEGATE
- | BANG
- | DOLLAR
- | LTH
- | HAT
- | TILDE
- | PIPE
- | IF
- | THEN
- | ELSE
- | DEF
- | LET
- | LOOP
- | IN
- | FOR
- | DO
- | WITH
- | ASSERT
- | TRUE
- | FALSE
- | WHILE
- | INCLUDE
- | IMPORT
- | ENTRY
- | TYPE
- | MODULE
- | VAL
- | OPEN
- | LOCAL
- | MATCH
- | CASE
- | DOC String
- | EOF
Documentation
parseFuthark :: FilePath -> Text -> Either ParseError UncheckedProg Source #
parseExp :: FilePath -> Text -> Either ParseError UncheckedExp Source #
parseModExp :: FilePath -> Text -> Either ParseError (ModExpBase NoInfo Name) Source #
parseType :: FilePath -> Text -> Either ParseError UncheckedTypeExp Source #
parseValue :: FilePath -> Text -> Either ParseError Value Source #
parseValues :: FilePath -> Text -> Either ParseError [Value] Source #
parseDecOrExpIncrM :: Monad m => m Text -> FilePath -> Text -> m (Either ParseError (Either UncheckedDec UncheckedExp)) Source #
Parse either an expression or a declaration incrementally; favouring declarations in case of ambiguity.
data ParseError Source #
A parse error. Use show
to get a human-readable description.
Instances
Show ParseError Source # | |
Defined in Language.Futhark.Parser.Parser showsPrec :: Int -> ParseError -> ShowS # show :: ParseError -> String # showList :: [ParseError] -> ShowS # |
scanTokensText :: Pos -> Text -> Either String ([L Token], Pos) Source #
Given a starting position, produce tokens from the given text (or a lexer error). Returns the final position.
A value tagged with a source location.
A lexical token. It does not itself contain position information, so in practice the parser will consume tokens tagged with a source position.