plutus-core-0.1.0.0: Language library for Plutus Core
Safe HaskellNone
LanguageHaskell2010

PlutusCore.Parser

Synopsis

Documentation

parseProgram :: (AsParseError e AlexPosn, MonadError e m, MonadQuote m) => ByteString -> m (Program TyName Name DefaultUni DefaultFun AlexPosn) Source #

Parse a PLC program. The resulting program will have fresh names. The underlying monad must be capable of handling any parse errors.

parseTerm :: (AsParseError e AlexPosn, MonadError e m, MonadQuote m) => ByteString -> m (Term TyName Name DefaultUni DefaultFun AlexPosn) Source #

Parse a PLC term. The resulting program will have fresh names. The underlying monad must be capable of handling any parse errors.

parseType :: (AsParseError e AlexPosn, MonadError e m, MonadQuote m) => ByteString -> m (Type TyName DefaultUni AlexPosn) Source #

Parse a PLC type. The resulting program will have fresh names. The underlying monad must be capable of handling any parse errors.

data ParseError ann Source #

An error encountered during parsing.

Instances

Instances details
Functor ParseError Source # 
Instance details

Defined in PlutusCore.Error

Methods

fmap :: (a -> b) -> ParseError a -> ParseError b Source #

(<$) :: a -> ParseError b -> ParseError a Source #

Eq ann => Eq (ParseError ann) Source # 
Instance details

Defined in PlutusCore.Error

Methods

(==) :: ParseError ann -> ParseError ann -> Bool Source #

(/=) :: ParseError ann -> ParseError ann -> Bool Source #

Ord ann => Ord (ParseError ann) Source # 
Instance details

Defined in PlutusCore.Error

Pretty ann => Show (ParseError ann) Source # 
Instance details

Defined in PlutusCore.Error

Generic (ParseError ann) Source # 
Instance details

Defined in PlutusCore.Error

Associated Types

type Rep (ParseError ann) :: Type -> Type Source #

Methods

from :: ParseError ann -> Rep (ParseError ann) x Source #

to :: Rep (ParseError ann) x -> ParseError ann Source #

NFData ann => NFData (ParseError ann) Source # 
Instance details

Defined in PlutusCore.Error

Methods

rnf :: ParseError ann -> () Source #

(Ord ann, Pretty ann) => ShowErrorComponent (ParseError ann) Source # 
Instance details

Defined in PlutusCore.ParserCommon

Pretty ann => Pretty (ParseError ann) Source # 
Instance details

Defined in PlutusCore.Error

Methods

pretty :: ParseError ann -> Doc ann0 Source #

prettyList :: [ParseError ann] -> Doc ann0 Source #

HasErrorCode (ParseError _a) Source # 
Instance details

Defined in PlutusCore.Error

AsParseError (ParseError ann) ann Source # 
Instance details

Defined in PlutusCore.Error

type Rep (ParseError ann) Source # 
Instance details

Defined in PlutusCore.Error

type Rep (ParseError ann)

type IdentifierState = (Map Text Unique, Unique) Source #

An IdentifierState includes a map indexed by Ints as well as a map indexed by ByteStrings. It is used during parsing.