class

Lexer

Inherits Reference < Object

Constructors

new(text : String, file_path : String, starting_line, log_level : Logger::Level = Logger::Level::Warning)
Source
new(reader : Reader, log : Logger)
Source

Instance methods

current_token
Source
get_string_lines(quote : String) : Range

this function should be called after the opening quote has already been consumed, and does not consume the end quote

Source
handle_import(path = "", column = 1)

parse_import is called when the reader encounters an "import" keyword at the top level. It parses the import statement and sends it to the compiler directly without the need for a separate parser.

Source
lex(tokens = [] of Token)
Source
next
Source
parse_import_alias
Source
parse_import_bindings
Source
parse_multiline_string(quote : Char, quote_width : Int)

function is called immediately after consumption of the opening quote

Source
parse_multiline_string_deprecated(quote : Char, quote_width, deprecated) : String
Source
parse_number
Source
parse_path
Source
parse_raw_string(num_backticks) : String
Source
parse_raw_string

DEPRECATED Use #parse_raw_string(num_backticks : Int) instead

Source
parse_string(quote : Char) : String
Source
parse_whitespace_delimited_string
Source
push_newline(loc : Location = @reader.location)

Skip over all whitespace and comments until the next significant character, and pushes a newline token

Source
push_number(loc : Location)
Source
push_operator(loc : Location)
Source
push_string(loc : Location, quote : Char)
Source
push_string(loc : Location)
Source
push_token(tok : Token)
Source
push_word(loc : Location, word : String)

handle the tokenization of a given word at the given location

Source
push_word_operator(loc, op)
Source
read_word(loc : Location = @reader.location) : String
Source
reader
Source
skip_comment

Consumes the remainder of the current line, but does not consume the newline.

Source
skip_horizantal_whitespace

Consumes all horizontal whitespace characters (spaces and tabs)

Source
skip_whitespace_and_comments

Consumes all comments and whitespace (including '\n') until the next non-whitespace character

Source
unescaped(line : String, indent, io : IO)
Source

Nested types