plutus-core-1.61.0.0: Language library for Plutus Core
Safe HaskellSafe-Inferred
LanguageHaskell2010

UntypedPlutusCore.Parser

Synopsis
  • parse :: (Text -> m PTerm #

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

parseProgram :: (Text -> m (Program Name DefaultUni DefaultFun SrcSpan) #

Parse a UPLC program. The resulting program will have fresh names. The underlying monad must be capable of handling any parse errors. This passes "test" to the parser as the name of the input stream; to supply a name explicity, use `parse program name inputText -> m (Program Name DefaultUni DefaultFun SrcSpan) #

Parse and rewrite so that names are globally unique, not just unique within their scope.

data SourcePos #

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

Instances details
Text.Megaparsec.Pos

type Rep SourcePos = D1 ('MetaData "SourcePos" "Text.Megaparsec.Pos" "megaparsec-9.7.0-9IxnAL1Z5n8HX9bf04jh9I" 'False) (C1 ('MetaCons "SourcePos" 'PrefixI 'True) (S1 ('MetaSel ('Just "sourceName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath) :*: (S1 ('MetaSel ('Just "sourceLine") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Pos) :*: S1 ('MetaSel ('Just "sourceColumn") 'NoSourceUnpackedness 'SourceStrict 'DecidedUnpack) (Rec0 Pos))))