futhark-0.25.32: An optimising compiler for a functional, array-oriented language.
Safe HaskellNone
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 :: 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

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 

Fields

Instances

Instances details
Show Comment Source # 
Instance details

Defined in Language.Futhark.Parser.Monad

Methods

showsPrec :: Int -> Comment -> ShowS

show :: Comment -> String

showList :: [Comment] -> ShowS

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

Methods

compare :: Comment -> Comment -> Ordering

(<) :: Comment -> Comment -> Bool

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

(>) :: Comment -> Comment -> Bool

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

max :: Comment -> Comment -> Comment

min :: Comment -> Comment -> Comment

Located Comment Source # 
Instance details

Defined in Language.Futhark.Parser.Monad