Equations
- Lean.instInhabitedPosition = { default := { line := default, column := default } }
Equations
- Lean.instReprPosition = { reprPrec := Lean.reprPosition✝ }
Equations
- Lean.instToJsonPosition = { toJson := Lean.toJsonPosition✝ }
Equations
- Lean.instFromJsonPosition = { fromJson? := Lean.fromJsonPosition✝ }
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
Equations
- Lean.Position.instToString = { toString := fun (x : Lean.Position) => match x with | { line := l, column := c } => "⟨" ++ toString l ++ ", " ++ toString c ++ "⟩" }
Equations
- One or more equations did not get rendered due to their size.
Content of a file together with precalculated positions of newlines.
- source : String
The content of the file.
- positions : Array String.Pos
The positions of newline characters. The first entry is always
0
and the last always the index of the last character. In particular, if the last character is a newline, that index will appear twice.
Instances For
Equations
- Lean.instInhabitedFileMap = { default := { source := default, positions := default } }
The last line should always be positions.size - 1
.
Instances For
Equations
- Lean.FileMap.ofString s = Lean.FileMap.ofString.loop s 0 1 #[0]
Instances For
partial def
Lean.FileMap.ofString.loop
(s : String)
(i : String.Pos)
(line : Nat)
(ps : Array String.Pos)
:
Equations
- One or more equations did not get rendered due to their size.
Instances For
partial def
Lean.FileMap.toPosition.toColumn
(pos : String.Pos)
(str : String)
(i : String.Pos)
(c : Nat)
:
partial def
Lean.FileMap.toPosition.loop
(fmap : Lean.FileMap)
(pos : String.Pos)
(str : String)
(ps : Array String.Pos)
(b : Nat)
(e : Nat)
:
Convert a Lean.Position
to a String.Pos
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Returns the position of the start of (1-based) line line
.
This gives the same result as map.ofPosition ⟨line, 0⟩
, but is more efficient.
Equations
Instances For
Equations
- s.toFileMap = Lean.FileMap.ofString s