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

PlutusIR.Parser

Description

Parsers for PIR terms in DefaultUni.

Synopsis

Documentation

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

pTypeParser PType Source #

Parser for PType.

pTermParser PTerm Source #

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

Parse a PIR 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`.

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

type Rep SourcePos 
Instance details

Defined in Text.Megaparsec.Pos

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