Signo.Position (Signo v0.0.2)

View Source

Records the position of a character or token in the original source code.

Summary

Functions

Updates the recorded pos given either a single grapheme, or a collected list of graphemes.

Types

path()

@type path() :: Path.t() | :nofile

t()

@type t() :: %Signo.Position{
  col: non_neg_integer(),
  path: path(),
  row: non_neg_integer()
}

Functions

increment(pos, lexeme)

@spec increment(t(), [String.grapheme()]) :: t()
@spec increment(t(), String.grapheme()) :: t()

Updates the recorded pos given either a single grapheme, or a collected list of graphemes.

new(path)

@spec new(path()) :: t()

new(path, row)

@spec new(path(), number()) :: t()