webql/compiler/lexer

Copy Markdown

Types

Lexer

pub opaque type Lexer

LexerMode

pub type LexerMode {
  Halt
  Recover
}
Halt
Recover

Values

lex

pub fn lex(
  lexer: Lexer,
) -> Result(List(token.Token), diagnostic.Diagnostic)

Takes a lexer source and converts it to a list of tokens.

new

pub fn new(source: String) -> Lexer

Creates a new lexer instance from a source.

with_comments

pub fn with_comments(
  lexer: Lexer,
  enabled comments: Bool,
) -> Lexer

Configures comments on an active lexer instance

with_mode

pub fn with_mode(lexer: Lexer, mode mode: LexerMode) -> Lexer

Configures stictness on an active lexer instance.

with_whitespace

pub fn with_whitespace(
  lexer: Lexer,
  enabled whitespace: Bool,
) -> Lexer

Configures whitespace on an active lexer instance