Safe Haskell | None |
---|---|
Language | Haskell2010 |
UntypedPlutusCore.Parser
Synopsis
- parse :: Parser a -> String -> Text -> Either (ParseErrorBundle Text ParseError) a
- parseQuoted :: Parser a -> String -> Text -> Quote (Either (ParseErrorBundle Text ParseError) a)
- term :: Parser PTerm
- program :: Parser (Program Name DefaultUni DefaultFun SourcePos)
- parseTerm :: ByteString -> Either (ParseErrorBundle Text ParseError) PTerm
- parseProgram :: ByteString -> Either (ParseErrorBundle Text ParseError) (Program Name DefaultUni DefaultFun SourcePos)
- parseScoped :: (MonadQuote (Either (ParseErrorBundle Text ParseError)), AsUniqueError (ParseErrorBundle Text ParseError) SourcePos) => ByteString -> Either (ParseErrorBundle Text ParseError) (Program Name DefaultUni DefaultFun SourcePos)
- type Parser = ParsecT ParseError Text (StateT ParserState Quote)
- data SourcePos
Documentation
parseQuoted :: Parser a -> String -> Text -> Quote (Either (ParseErrorBundle Text ParseError) a) Source #
program :: Parser (Program Name DefaultUni DefaultFun SourcePos) Source #
Parser for UPLC programs.
parseTerm :: ByteString -> Either (ParseErrorBundle Text ParseError) 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 :: ByteString -> Either (ParseErrorBundle Text ParseError) (Program Name DefaultUni DefaultFun SourcePos) Source #
Parse a UPLC program. The resulting program will have fresh names. The underlying monad must be capable of handling any parse errors.
parseScoped :: (MonadQuote (Either (ParseErrorBundle Text ParseError)), AsUniqueError (ParseErrorBundle Text ParseError) SourcePos) => ByteString -> Either (ParseErrorBundle Text ParseError) (Program Name DefaultUni DefaultFun SourcePos) Source #
Parse and rewrite so that names are globally unique, not just unique within their scope.
type Parser = ParsecT ParseError Text (StateT ParserState Quote) Source #
Instances
Eq SourcePos | |
Data SourcePos | |
Defined in Text.Megaparsec.Pos Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SourcePos -> c SourcePos Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SourcePos Source # toConstr :: SourcePos -> Constr Source # dataTypeOf :: SourcePos -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SourcePos) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SourcePos) Source # gmapT :: (forall b. Data b => b -> b) -> SourcePos -> SourcePos Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SourcePos -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SourcePos -> r Source # gmapQ :: (forall d. Data d => d -> u) -> SourcePos -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> SourcePos -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> SourcePos -> m SourcePos Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SourcePos -> m SourcePos Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SourcePos -> m SourcePos Source # | |
Ord SourcePos | |
Defined in Text.Megaparsec.Pos | |
Read SourcePos | |
Show SourcePos | |
Generic SourcePos | |
NFData SourcePos | |
Defined in Text.Megaparsec.Pos | |
Pretty SourcePos Source # | |
Defined in PlutusCore.Error | |
type Rep SourcePos | |
Defined in Text.Megaparsec.Pos type Rep SourcePos = D1 ('MetaData "SourcePos" "Text.Megaparsec.Pos" "megaparsec-9.2.1-EI4cRL0SAfYAOxBOfPeCV9" '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)))) |