Parser utils for ReaderT and StateT
extends Lean.Parser.attempt
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Parser.instHOrElseParserReaderTStateT_regex = { hOrElse := Parser.orElseT }
def
Parser.tryCatchT
{σ α β : Type}
(p : StateT σ Std.Internal.Parsec.String.Parser α)
(csuccess : α → StateT σ Std.Internal.Parsec.String.Parser β)
(cerror : Unit → StateT σ Std.Internal.Parsec.String.Parser β)
:
extends Lean.Parser.tryCatch
Equations
- One or more equations did not get rendered due to their size.
Instances For
def
Parser.manyM
{ρ σ α : Type}
(p : ReaderT ρ (StateT σ Std.Internal.Parsec.String.Parser) α)
:
ReaderT ρ (StateT σ Std.Internal.Parsec.String.Parser) (Array α)
extends Lean.Parser.many
Equations
- Parser.manyM p = do let __do_lift ← read liftM (Parser.manyCoreT (p __do_lift) #[])
Instances For
Equations
- Parser.failM msg = liftM (Std.Internal.Parsec.fail msg)
Instances For
Equations
- Parser.peekChar? = Std.Internal.Parsec.peek?
Instances For
Equations
- Parser.peekChar! = Std.Internal.Parsec.peek!
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Parser.withPosSkip = do let __discr ← Parser.withPos Std.Internal.Parsec.skip match __discr with | (fst, t, snd) => pure t
Instances For
Equations
Instances For
Equations
- Parser.optSkipString s = do let __do_lift ← Std.Internal.Parsec.peek? match __do_lift with | some val => Std.Internal.Parsec.String.skipString s | none => pure ()
Instances For
exec check
on current char
Equations
Instances For
exec check
on current char and consume char on success
Equations
- One or more equations did not get rendered due to their size.
Instances For
exec check
on current char and skip char on success
Equations
- Parser.trySkipChar check = do let __do_lift ← Parser.tryChar check match __do_lift with | some val => pure true | x => pure false
Instances For
exec check
on current char and then exec f
on consumed char on success
Equations
- Parser.tryCharThen check f msg = do let __do_lift ← Parser.tryChar check match __do_lift with | some c => pure (f c) | x => Std.Internal.Parsec.fail msg
Instances For
exec check
on current char and map f
on consumed char on success
Equations
- Parser.tryCharMap check f = do let __do_lift ← Parser.tryChar check match __do_lift with | some c => pure (some (f c)) | x => pure none
Instances For
def
Parser.tryCharThenPWithPos
{α : Type}
(check : Char → Bool)
(p : Std.Internal.Parsec.String.Parser α)
:
exec check
on current char and then exec p
on success
Equations
- One or more equations did not get rendered due to their size.
Instances For
def
Parser.tryCharThenPWithPosM
{ρ σ α : Type}
(check : Char → Bool)
(p : ReaderT ρ (StateT σ Std.Internal.Parsec.String.Parser) α)
:
ReaderT ρ (StateT σ Std.Internal.Parsec.String.Parser) (Option (String.Pos × String.Pos × α))
exec check
on current char and then exec p
on success
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Parser.tryCharWithPos check = Parser.tryCharThenPWithPos check Std.Internal.Parsec.any
Instances For
def
Parser.tryCharWithPosMap
{α : Type}
(check : Char → Bool)
(f : Char → String.Pos → String.Pos → α)
:
Equations
- Parser.tryCharWithPosMap check f = do let __do_lift ← Parser.tryCharWithPos check match __do_lift with | some (p1, p2, c) => pure (some (f c p1 p2)) | x => pure none