Signo.Token (Signo v0.0.2)

View Source

A token.

Summary

Types

The value of the literal as an elixir term/0. Example: 30_000.

t()

A token.

Types

literal()

@type literal() :: binary() | number() | atom()

The value of the literal as an elixir term/0. Example: 30_000.

t()

@type t() :: %Signo.Token{
  lexeme: binary(),
  pos: Signo.Position.t(),
  type: type() | :error
}

A token.

Has the following fields:

  • type: the type of token, see type/0.
  • lexeme: the string as found in the source code.
  • pos: the Signo.Position where the source string was found.

type()

@type type() :: :eof | :opening | :closing | :quote | :symbol | {:literal, literal()}

Functions

new(type, lexeme, pos)

@spec new(type(), binary(), Signo.Position.t()) :: t()