class
Parser.Stream
(σ : Type u_1)
(τ : outParam (Type u_2))
extends Stream σ τ :
Type (max (max u_1 u_2) (u_3 + 1))
Parser.Stream
class extends Stream
with position features
- Position : Type u_3
Position type
- getPosition : σ → Position σ
Get current stream position
- setPosition : σ → Position σ → σ
Set current stream position
Instances
Stream segment
Equations
Instances For
@[reducible, inline]
abbrev
Parser.Stream.Segment.start
{σ : Type u_1}
{τ : Type u_2}
[Parser.Stream σ τ]
(s : Segment σ)
:
Position σ
Start position of stream segment
Instances For
@[reducible, inline]
abbrev
Parser.Stream.Segment.stop
{σ : Type u_1}
{τ : Type u_2}
[Parser.Stream σ τ]
(s : Segment σ)
:
Position σ
Stop position of stream segment
Instances For
Wrapper to make a Parser.Stream
from a core Stream
Equations
- Parser.Stream.mkDefault σ τ = σ
Instances For
@[reducible]
instance
Parser.Stream.instMkDefault
(σ : Type u_1)
(τ : Type u_2)
[self : Stream σ τ]
:
Parser.Stream (mkDefault σ τ) τ
Equations
- Parser.Stream.instMkDefault σ τ = Parser.Stream.mk σ (fun (s : Parser.Stream.mkDefault σ τ) => s) fun (x : Parser.Stream.mkDefault σ τ) (p : σ) => p
@[reducible]
Equations
- One or more equations did not get rendered due to their size.
@[reducible]
Equations
- One or more equations did not get rendered due to their size.
@[reducible]
Equations
- One or more equations did not get rendered due to their size.
Equations
- Parser.Stream.OfList.setPosition.fwd k.succ { next := x_2 :: rest, past := past } = Parser.Stream.OfList.setPosition.fwd k { next := rest, past := x_2 :: past }
- Parser.Stream.OfList.setPosition.fwd x✝¹ x✝ = x✝
Instances For
Equations
- Parser.Stream.OfList.setPosition.rev k.succ { next := rest, past := x_2 :: past } = Parser.Stream.OfList.setPosition.rev k { next := x_2 :: rest, past := past }
- Parser.Stream.OfList.setPosition.rev x✝¹ x✝ = x✝
Instances For
Make a Parser.Stream
from a List
Equations
- Parser.Stream.mkOfList data pos = { next := data, past := [] }.setPosition pos
Instances For
@[reducible]
Equations
- Parser.Stream.instOfList τ = Parser.Stream.mk Nat (fun (s : Parser.Stream.OfList τ) => s.past.length) Parser.Stream.OfList.setPosition