File: .lake/packages/lean4/src/lean/Lean/Data/Position.lean

full_name: Lean.Position
code: structure Position where
  line   : Nat
  column : Nat
  deriving Inhabited, DecidableEq, Repr, ToJson, FromJson
goal: Type

full_name: Lean.instReprPosition
code: structure Position where
  line   : Nat
  column : Nat
  deriving Inhabited, DecidableEq, Repr, ToJson, FromJson
goal: Repr Lean.Position

full_name: Lean.instInhabitedPosition
code: structure Position where
  line   : Nat
  column : Nat
  deriving Inhabited, DecidableEq, Repr, ToJson, FromJson
goal: Inhabited Lean.Position

full_name: Lean.Position.column
code: structure Position where
  line   : Nat
  column : Nat
  deriving Inhabited, DecidableEq, Repr, ToJson, FromJson
goal: Nat

full_name: Lean.Position.line
code: structure Position where
  line   : Nat
  column : Nat
  deriving Inhabited, DecidableEq, Repr, ToJson, FromJson
goal: Nat

full_name: Lean.instToJsonPosition
code: ToJson
goal: Lean.ToJson Lean.Position

full_name: Lean.instFromJsonPosition
code: FromJson
goal: Lean.FromJson Lean.Position

full_name: Lean.Position.lt
code: protected def lt : Position → Position → Bool
  
goal: Lean.Position → Lean.Position → Bool

full_name: Lean.Position.instToFormat
code: instance : ToFormat Position 
goal: Lean.ToFormat Lean.Position

full_name: Lean.Position.instToString
code: instance : ToString Position 
goal: ToString Lean.Position

full_name: Lean.Position.instToExpr
code: instance : ToExpr Position 
goal: Lean.ToExpr Lean.Position

full_name: Lean.FileMap
code: /-- Content of a file together with precalculated positions of newlines. -/
structure FileMap where
  /-- The content of the file. -/
  source    : String
  /-- 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. -/
  positions : Array String.Pos
  deriving Inhabited
goal: Type

full_name: Lean.FileMap.source
code: /-- Content of a file together with precalculated positions of newlines. -/
structure FileMap where
  /-- The content of the file. -/
  source    : String
  /-- 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. -/
  positions : Array String.Pos
  deriving Inhabited
goal: String

full_name: Lean.FileMap.positions
code: /-- Content of a file together with precalculated positions of newlines. -/
structure FileMap where
  /-- The content of the file. -/
  source    : String
  /-- 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. -/
  positions : Array String.Pos
  deriving Inhabited
goal: Array String.Pos

full_name: Lean.instInhabitedFileMap
code: /-- Content of a file together with precalculated positions of newlines. -/
structure FileMap where
  /-- The content of the file. -/
  source    : String
  /-- 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. -/
  positions : Array String.Pos
  deriving Inhabited
goal: Inhabited Lean.FileMap

full_name: Lean.MonadFileMap
code: class MonadFileMap (m : Type → Type) where
  getFileMap : m FileMap
goal: Type

full_name: Lean.MonadFileMap.getFileMap
code: class MonadFileMap (m : Type → Type) where
  getFileMap : m FileMap
goal: m Lean.FileMap

full_name: Lean.FileMap.getLastLine
code: /-- The last line should always be `positions.size - 1`. -/
def getLastLine (fmap : FileMap) : Nat 
goal: Nat

full_name: Lean.FileMap.getLine
code: /-- The line numbers associated with the `positions` of the `FileMap`.
`fmap.getLine i` is the iᵗʰ entry of `#[1, 2, …, n-1, n-1]`
where `n` is the `size` of `positions`. -/
def getLine (fmap : FileMap) (x : Nat) : Nat 
goal: Nat

full_name: Lean.FileMap.ofString.loop
code: partial def ofString (s : String) : FileMap 
goal: Lean.FileMap

full_name: Lean.FileMap.ofString
code: partial def ofString (s : String) : FileMap 
goal: Lean.FileMap

full_name: Lean.FileMap.toPosition
code: partial def toPosition (fmap : FileMap) (pos : String.Pos) : Position 
goal: Lean.Position

full_name: Lean.FileMap.toPosition.loop
code: partial def toPosition (fmap : FileMap) (pos : String.Pos) : Position 
goal: Lean.Position

full_name: Lean.FileMap.toPosition.toColumn
code: partial def toPosition (fmap : FileMap) (pos : String.Pos) : Position 
goal: Nat

full_name: Lean.FileMap.ofPosition
code: /-- Convert a `Lean.Position` to a `String.Pos`. -/
def ofPosition (text : FileMap) (pos : Position) : String.Pos 
goal: String.Pos

full_name: Lean.FileMap.lineStart
code: /--
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.
-/
def lineStart (map : FileMap) (line : Nat) : String.Pos 
goal: String.Pos

full_name: String.toFileMap
code: def String.toFileMap (s : String) : Lean.FileMap 
goal: Lean.FileMap