futhark-0.25.15: An optimising compiler for a functional, array-oriented language.
Safe HaskellSafe-Inferred
LanguageGHC2021

Language.Futhark.Parser

Description

Interface to the Futhark parser.

Synopsis

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 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 

data Comment Source #

A comment consists of its starting and end position, as well as its text. The contents include the comment start marker.

Constructors

Comment 

Instances

Instances details
Show Comment Source # 
Instance details

Defined in Language.Futhark.Parser.Monad

Eq Comment Source # 
Instance details

Defined in Language.Futhark.Parser.Monad

Methods

(==) :: Comment -> Comment -> Bool #

(/=) :: Comment -> Comment -> Bool #

Ord Comment Source # 
Instance details

Defined in Language.Futhark.Parser.Monad

Located Comment Source # 
Instance details

Defined in Language.Futhark.Parser.Monad

Methods

locOf :: Comment -> Loc #

locOfList :: [Comment] -> Loc #