AyeSQL.Lexer (AyeSQL v1.1.4)

Copy Markdown View Source

This module defines the lexer for the AyeSQL language.

Summary

Types

Column number.

Line number.

Location.

Lexer option.

Lexer options.

Original match from the string.

Token.

Token name.

Tokens.

Token value.

Functions

Gets tokens from the contents of a string.

Types

column()

@type column() :: pos_integer()

Column number.

line()

@type line() :: pos_integer()

Line number.

location()

@type location() :: {line(), column()}

Location.

option()

@type option() :: {:error_context, pos_integer()} | {:filename, Path.t()}

Lexer option.

options()

@type options() :: [option()]

Lexer options.

original()

@type original() :: binary()

Original match from the string.

token()

@type token() :: {token_name(), line(), {value(), original(), location()}}

Token.

token_name()

@type token_name() :: :"$name" | :"$docs" | :"$fragment" | :"$named_param"

Token name.

tokens()

@type tokens() :: [token()]

Tokens.

value()

@type value() :: binary()

Token value.

Functions

tokenize(contents, options \\ [])

@spec tokenize(binary(), options()) :: tokens() | no_return()

Gets tokens from the contents of a string.