- success: {α : Type} → String.Iterator → α → Lean.Parsec.ParseResult α
- error: {α : Type} → String.Iterator → String → Lean.Parsec.ParseResult α
Instances For
instance
Lean.Parsec.instReprParseResult :
{α : Type} → [inst : Repr α] → Repr (Lean.Parsec.ParseResult α)
Equations
- Lean.Parsec.instReprParseResult = { reprPrec := Lean.Parsec.reprParseResult✝ }
Equations
Instances For
Equations
- Lean.Parsec.instInhabitedParsec α = { default := fun (it : String.Iterator) => Lean.Parsec.ParseResult.error it "" }
@[inline]
Equations
- Lean.Parsec.bind f g it = match f it with | Lean.Parsec.ParseResult.success rem a => g a rem | Lean.Parsec.ParseResult.error pos msg => Lean.Parsec.ParseResult.error pos msg
Instances For
Equations
- Lean.Parsec.instMonadParsec = Monad.mk
@[inline]
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[inline]
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lean.Parsec.instAlternativeParsec = Alternative.mk (fun {α : Type} => Lean.Parsec.fail "") fun {α : Type} => Lean.Parsec.orElse
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lean.Parsec.expectedEndOfInput = "expected end of input"
Instances For
@[inline]
Equations
Instances For
@[specialize #[]]
partial def
Lean.Parsec.manyCore
{α : Type}
(p : Lean.Parsec α)
(acc : Array α)
:
Lean.Parsec (Array α)
@[inline]
Equations
- Lean.Parsec.many1 p = do let __do_lift ← p Lean.Parsec.manyCore p #[__do_lift]
Instances For
@[specialize #[]]
@[inline]
Equations
Instances For
@[inline]
Equations
- Lean.Parsec.many1Chars p = do let __do_lift ← p Lean.Parsec.manyCharsCore p (Char.toString __do_lift)
Instances For
Parses the given string.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[inline]
Equations
- Lean.Parsec.skipString s = SeqRight.seqRight (Lean.Parsec.pstring s) fun (x : Unit) => pure ()
Instances For
Equations
- Lean.Parsec.unexpectedEndOfInput = "unexpected end of input"
Instances For
@[inline]
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[inline]
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[inline]
Equations
- Lean.Parsec.skipChar c = SeqRight.seqRight (Lean.Parsec.pchar c) fun (x : Unit) => pure ()
Instances For
@[inline]
Equations
- Lean.Parsec.digit = Lean.Parsec.attempt do let c ← Lean.Parsec.anyChar if '0' ≤ c ∧ c ≤ '9' then pure c else Lean.Parsec.fail (toString "digit expected")
Instances For
@[inline]
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[inline]
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[inline]
Equations
- Lean.Parsec.satisfy p = Lean.Parsec.attempt do let c ← Lean.Parsec.anyChar if p c = true then pure c else Lean.Parsec.fail "condition not satisfied"
Instances For
@[inline]
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[inline]
Equations
- Lean.Parsec.peek? it = if String.Iterator.hasNext it = true then Lean.Parsec.ParseResult.success it (some (String.Iterator.curr it)) else Lean.Parsec.ParseResult.success it none
Instances For
@[inline]
Equations
- Lean.Parsec.peek! = do let __discr ← Lean.Parsec.peek? match __discr with | some c => pure c | x => Lean.Parsec.fail Lean.Parsec.unexpectedEndOfInput
Instances For
@[inline]
Equations
Instances For
@[inline]