- success: {α : Type} → String.Iterator → α → Lean.Parsec.ParseResult α
- error: {α : Type} → String.Iterator → String → Lean.Parsec.ParseResult α
instance
Lean.Parsec.instReprParseResult:
{α : Type} → [inst : Repr α] → Repr (Lean.Parsec.ParseResult α)
Equations
- Lean.Parsec.instReprParseResult = { reprPrec := [anonymous] }
Equations
Equations
- Lean.Parsec.instInhabitedParsec α = { default := fun it => Lean.Parsec.ParseResult.error it "" }
@[inline]
Equations
- Lean.Parsec.pure a it = Lean.Parsec.ParseResult.success it a
@[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
Equations
- Lean.Parsec.instMonadParsec = Monad.mk
@[inline]
Equations
- Lean.Parsec.fail msg it = Lean.Parsec.ParseResult.error it msg
@[inline]
Equations
- One or more equations did not get rendered due to their size.
@[inline]
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.Parsec.instAlternativeParsec = Alternative.mk (fun {α} => Lean.Parsec.fail "") fun {α} => Lean.Parsec.orElse
Equations
- Lean.Parsec.expectedEndOfInput = "expected end of input"
@[inline]
Equations
@[inline]
partial def
Lean.Parsec.manyCore
{α : Type}
(p : Lean.Parsec α)
(acc : Array α)
:
Lean.Parsec (Array α)
@[inline]
Equations
- Lean.Parsec.many p = Lean.Parsec.manyCore p #[]
@[inline]
Equations
- Lean.Parsec.many1 p = do let a ← p Lean.Parsec.manyCore p #[a]
@[inline]
@[inline]
Equations
- Lean.Parsec.manyChars p = Lean.Parsec.manyCharsCore p ""
@[inline]
Equations
- Lean.Parsec.many1Chars p = do let a ← p Lean.Parsec.manyCharsCore p (Char.toString a)
Equations
- One or more equations did not get rendered due to their size.
@[inline]
Equations
- Lean.Parsec.skipString s = SeqRight.seqRight (Lean.Parsec.pstring s) fun x => pure ()
Equations
- Lean.Parsec.unexpectedEndOfInput = "unexpected end of input"
@[inline]
Equations
- One or more equations did not get rendered due to their size.
@[inline]
Equations
- Lean.Parsec.pchar c = Lean.Parsec.attempt do let a ← Lean.Parsec.anyChar if a = c then pure c else Lean.Parsec.fail (toString "expected: '" ++ toString c ++ toString "'")
@[inline]
Equations
- Lean.Parsec.skipChar c = SeqRight.seqRight (Lean.Parsec.pchar c) fun x => pure ()
@[inline]
Equations
- Lean.Parsec.digit = Lean.Parsec.attempt do let c ← Lean.Parsec.anyChar if Char.ofNat 48 ≤ c ∧ c ≤ Char.ofNat 57 then pure c else Lean.Parsec.fail (toString "digit expected")
@[inline]
Equations
- One or more equations did not get rendered due to their size.
@[inline]
Equations
- One or more equations did not get rendered due to their size.
@[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"
@[inline]
Equations
- One or more equations did not get rendered due to their size.
@[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
@[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
@[inline]
Equations
@[inline]