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

UntypedPlutusCore.Parser

Synopsis

Documentation

parse ∷ (AsParserErrorBundle e, MonadError e m, MonadQuote m) ⇒ Parser a → StringText → m a Source #

termParser PTerm Source #

Parser for all UPLC terms.

programParser (Program Name DefaultUni DefaultFun SrcSpan) Source #

Parser for UPLC programs.

parseTerm ∷ (AsParserErrorBundle e, MonadError e m, MonadQuote m) ⇒ Text → m PTerm Source #

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

parseProgram ∷ (AsParserErrorBundle e, MonadError e m, MonadQuote m) ⇒ Text → m (Program Name DefaultUni DefaultFun SrcSpan) Source #

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

parseScoped ∷ (AsParserErrorBundle e, AsUniqueError e SrcSpan, MonadError e m, MonadQuote m) ⇒ Text → m (Program Name DefaultUni DefaultFun SrcSpan) Source #

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

data SourcePos Source #

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
Data SourcePos 
Instance details

Defined in Text.Megaparsec.Pos

Methods

gfoldl ∷ (∀ d b. Data d ⇒ c (d → b) → d → c b) → (∀ g. g → c g) → SourcePos → c SourcePos Source #

gunfold ∷ (∀ b r. Data b ⇒ c (b → r) → c r) → (∀ r. r → c r) → Constr → c SourcePos Source #

toConstrSourcePosConstr Source #

dataTypeOfSourcePosDataType Source #

dataCast1Typeable t ⇒ (∀ d. Data d ⇒ c (t d)) → Maybe (c SourcePos) Source #

dataCast2Typeable t ⇒ (∀ d e. (Data d, Data e) ⇒ c (t d e)) → Maybe (c SourcePos) Source #

gmapT ∷ (∀ b. Data b ⇒ b → b) → SourcePosSourcePos Source #

gmapQl ∷ (r → r' → r) → r → (∀ d. Data d ⇒ d → r') → SourcePos → r Source #

gmapQr ∷ ∀ r r'. (r' → r → r) → r → (∀ d. Data d ⇒ d → r') → SourcePos → r Source #

gmapQ ∷ (∀ d. Data d ⇒ d → u) → SourcePos → [u] Source #

gmapQiInt → (∀ d. Data d ⇒ d → u) → SourcePos → u Source #

gmapMMonad m ⇒ (∀ d. Data d ⇒ d → m d) → SourcePos → m SourcePos Source #

gmapMpMonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → SourcePos → m SourcePos Source #

gmapMoMonadPlus m ⇒ (∀ d. Data d ⇒ d → m d) → SourcePos → m SourcePos Source #

Generic SourcePos 
Instance details

Defined in Text.Megaparsec.Pos

Associated Types

type Rep SourcePosTypeType Source #

Read SourcePos 
Instance details

Defined in Text.Megaparsec.Pos

Show SourcePos 
Instance details

Defined in Text.Megaparsec.Pos

NFData SourcePos 
Instance details

Defined in Text.Megaparsec.Pos

Methods

rnfSourcePos → () Source #

Eq SourcePos 
Instance details

Defined in Text.Megaparsec.Pos

Ord SourcePos 
Instance details

Defined in Text.Megaparsec.Pos

Pretty SourcePos Source # 
Instance details

Defined in PlutusCore.Error

Methods

prettySourcePosDoc ann Source #

prettyList ∷ [SourcePos] → Doc ann Source #

type Rep SourcePos 
Instance details

Defined in Text.Megaparsec.Pos

type Rep SourcePos = D1 ('MetaData "SourcePos" "Text.Megaparsec.Pos" "megaparsec-9.6.1-2y4TSvMYdIdIGL4Xdwvkcx" '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))))