Equations
- Lean.instInhabitedPosition = { default := { line := default, column := default } }
Equations
- Lean.instReprPosition = { reprPrec := Lean.reprPosition✝ }
Equations
- Lean.Position.lt x✝ x = match x✝, x with | { line := l₁, column := c₁ }, { line := l₂, column := c₂ } => decide (Prod.lexLt (l₁, c₁) (l₂, c₂))
Instances For
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
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, lines := default } }
Equations
- Lean.FileMap.ofString s = Lean.FileMap.ofString.loop s 0 1 #[0] #[1]
Instances For
partial def
Lean.FileMap.ofString.loop
(s : String)
(i : String.Pos)
(line : Nat)
(ps : Array String.Pos)
(lines : Array Nat)
:
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
(pos : String.Pos)
(str : String)
(ps : Array String.Pos)
(lines : Array Nat)
(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 stame result as map.ofPosition ⟨line, 0⟩
, but is more efficient.
Equations
- Lean.FileMap.lineStart map line = if h : line - 1 < Array.size map.positions then Array.get map.positions { val := line - 1, isLt := h } else Option.getD (Array.back? map.positions) 0