Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Parsers for PLC terms in DefaultUni.
Synopsis
- module PlutusCore.Parser.Type
- module PlutusCore.Parser.ParserCommon
- module PlutusCore.Parser.Builtin
- program ∷ Parser (Program TyName Name DefaultUni DefaultFun SrcSpan)
- parseProgram ∷ (AsParserErrorBundle e, MonadError e m, MonadQuote m) ⇒ Text → m (Program TyName Name DefaultUni DefaultFun SrcSpan)
- parseTerm ∷ (AsParserErrorBundle e, MonadError e m, MonadQuote m) ⇒ Text → m (Term TyName Name DefaultUni DefaultFun SrcSpan)
- parseType ∷ (AsParserErrorBundle e, MonadError e m, MonadQuote m) ⇒ Text → m (Type TyName DefaultUni SrcSpan)
- data SourcePos
- data ParserError
Documentation
module PlutusCore.Parser.Type
module PlutusCore.Parser.Builtin
program ∷ Parser (Program TyName Name DefaultUni DefaultFun SrcSpan) Source #
Parser for PLC programs.
parseProgram ∷ (AsParserErrorBundle e, MonadError e m, MonadQuote m) ⇒ Text → m (Program TyName Name DefaultUni DefaultFun SrcSpan) Source #
parseTerm ∷ (AsParserErrorBundle e, MonadError e m, MonadQuote m) ⇒ Text → m (Term TyName Name DefaultUni DefaultFun SrcSpan) Source #
Parse a PLC term. The resulting program will have fresh names. The underlying monad must be capable of handling any parse errors.
parseType ∷ (AsParserErrorBundle e, MonadError e m, MonadQuote m) ⇒ Text → m (Type TyName DefaultUni SrcSpan) Source #
Parse a PLC type. The resulting program will have fresh names. The underlying monad must be capable of handling any parse errors.
The data type SourcePos
represents source positions. It contains the
name of the source file, a line number, and a column number. Source line
and column positions change intensively during parsing, so we need to
make them strict to avoid memory leaks.
Instances
data ParserError Source #
An error encountered during parsing.
BuiltinTypeNotAStar !Text !SourcePos | |
UnknownBuiltinFunction !Text !SourcePos ![Text] | |
InvalidBuiltinConstant !Text !Text !SourcePos |