| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Language.Futhark.Parser
Description
Interface to the Futhark parser.
Synopsis
- parseFuthark :: FilePath -> Text -> Either SyntaxError UncheckedProg
- parseFutharkWithComments :: FilePath -> Text -> Either SyntaxError (UncheckedProg, [Comment])
- parseExp :: FilePath -> Text -> Either SyntaxError UncheckedExp
- parseModExp :: FilePath -> Text -> Either SyntaxError (ModExpBase (NoInfo :: Type -> Type) Name)
- parseType :: FilePath -> Text -> Either SyntaxError UncheckedTypeExp
- parseDecOrExp :: FilePath -> Text -> Either SyntaxError (Either UncheckedDec UncheckedExp)
- data SyntaxError = SyntaxError {
- syntaxErrorLoc :: Loc
- syntaxErrorMsg :: Text
- data Comment = Comment {
- commentLoc :: Loc
- commentText :: Text
Documentation
parseFuthark :: FilePath -> Text -> Either SyntaxError UncheckedProg Source #
Parse an entire Futhark program from the given Text, using
the FilePath as the source name for error messages.
parseFutharkWithComments :: FilePath -> Text -> Either SyntaxError (UncheckedProg, [Comment]) Source #
Parse an entire Futhark program from the given Text, using
the FilePath as the source name for error messages. Also returns
the comments encountered.
parseExp :: FilePath -> Text -> Either SyntaxError UncheckedExp Source #
Parse an Futhark expression from the given String, using the
FilePath as the source name for error messages.
parseModExp :: FilePath -> Text -> Either SyntaxError (ModExpBase (NoInfo :: Type -> Type) Name) Source #
Parse a Futhark module expression from the given String, using the
FilePath as the source name for error messages.
parseType :: FilePath -> Text -> Either SyntaxError UncheckedTypeExp Source #
Parse an Futhark type from the given String, using the
FilePath as the source name for error messages.
parseDecOrExp :: FilePath -> Text -> Either SyntaxError (Either UncheckedDec UncheckedExp) Source #
Parse either an expression or a declaration; favouring declarations in case of ambiguity.
data SyntaxError Source #
A syntax error.
Constructors
| SyntaxError | |
Fields
| |