Skip to content

class Crystal::Lexer
inherits Reference

Direct known subclasses

Crystal::Parser

Class methods

.new(string, string_pool : StringPool? = nil)

View source

Methods

#absolute_integer_value(string_value, negative)

View source

#char_to_hex

View source

#check_heredoc_end(delimiter_state)

View source

#check_heredoc_start

View source

#check_ident_or_keyword(symbol, start)

View source

#check_integer_literal_fits_in_size(string_value, num_size, negative, start)

View source

#check_macro_opening_keyword(beginning_of_line)

View source

#check_negative_value_fits_in_int64(string_value, num_size, start)

View source

#check_value_fits_in_uint64(string_value, num_size, start)

View source

#closing_char(char = current_char)

View source

#column_number : Int32

View source

#column_number=(column_number : Int32)

View source

#comments_enabled=(comments_enabled : Bool)

View source

#comments_enabled? : Bool

View source

#consume_braced_unicode_escape(allow_spaces = false)

View source

#consume_char_unicode_escape

View source

#consume_comment(start_pos)

View source

#consume_doc

View source

#consume_float_suffix

View source

#consume_int_suffix

View source

#consume_loc_pragma

View source

#consume_newlines

View source

#consume_non_braced_unicode_escape

View source

#consume_octal_escape(char)

View source

#consume_string_hex_escape

View source

#consume_string_unicode_brace_escape

View source

#consume_string_unicode_escape

View source

#consume_uint_suffix

View source

#consume_whitespace

View source

#count_whitespace=(count_whitespace : Bool)

View source

#count_whitespace? : Bool

View source

#current_char

View source

#current_pos

View source

#current_pos=(pos)

View source

#deduce_integer_kind(string_value, num_size, negative, start)

View source

#delimited_pair(kind, string_nest, string_end, start, allow_escapes = true, advance = true)

View source

#doc_enabled=(doc_enabled : Bool)

View source

#doc_enabled? : Bool

View source

#expected_hexacimal_character_in_unicode_escape

View source

#filename=(filename)

View source

#finish_scan_prefixed_number(num, negative, start)

View source

#heredocs : Array({Crystal::Token::DelimiterState, Crystal::Lexer::HeredocItem})

Heredocs pushed when found. Should be processed when encountering a newline

View source

#ident_part?(char)

View source

#ident_part_or_end?(char)

View source

#ident_start?(char)

View source

#incr_column_number(d = 1)

View source

#incr_line_number(column_number = 1)

View source

#line_number : Int32

View source

#line_number=(line_number : Int32)

View source

#lookahead

View source

#macro_expansion_pragmas : Hash(Int32, Array(LocPragma))?

View source

#macro_expansion_pragmas=(macro_expansion_pragmas : Hash(Int32, Array(LocPragma))?)

View source

#next_char

View source

#next_char(token_type)

View source

#next_char_and_symbol(value)

View source

#next_char_check_line

View source

#next_char_no_column_increment

View source

#next_macro_token(macro_state, skip_whitespace)

View source

#next_string_array_token

View source

#next_string_token(delimiter_state)

View source

#next_string_token_noescape(delimiter_state)

View source

#next_token

View source

#next_token_never_a_symbol

View source

#next_token_skip_space

View source

#next_token_skip_space_or_newline

View source

#next_token_skip_statement_end

View source

#peek_next_char

View source

#peek_not_ident_part_or_end_next_char

View source

#pop_location

View source

#push_location

View source

#raise(message, line_number = @line_number, column_number = @column_number, filename = @filename)

View source

#raise(message, location : Location)

View source

#raise(message, token : Token, size = nil)

View source

#raise_unterminated_quoted(delimiter_state)

View source

#raise_value_doesnt_fit_in(type, string_value, start)

View source

#reset_token

View source

#scan_bin_number(start, negative)

View source

#scan_hex_number(start, negative = false)

View source

#scan_ident(start)

View source

#scan_number(start, negative = false)

View source

#scan_octal_number(start, negative)

View source

#scan_zero_number(start, negative = false)

View source

#set_location(filename, line_number, column_number)

View source

#set_token_raw_from_start(start)

View source

#skip_comment

View source

#skip_macro_whitespace

View source

#skip_space

View source

#skip_space_or_newline

View source

#skip_statement_end

View source

#slash_is_not_regex!

View source

#slash_is_regex!

View source

#slash_is_regex=(slash_is_regex : Bool)

View source

#slash_is_regex? : Bool

View source

#slice_range(start_pos)

View source

#slice_range(start_pos, end_pos)

View source

#string

View source

#string_range(start_pos, end_pos)

View source

#string_range(start_pos)

View source

#string_range_from_pool(start_pos)

View source

#string_range_from_pool(start_pos, end_pos)

View source

#string_token_escape_value(value)

View source

#symbol(value)

View source

#token : Token

View source

#token_end_location

View source

#unknown_token

View source

#wants_def_or_macro_name=(wants_def_or_macro_name : Bool)

View source

#wants_def_or_macro_name? : Bool

View source

#wants_raw=(wants_raw : Bool)

View source

#wants_raw? : Bool

View source

#wants_symbol : Bool

View source

#wants_symbol=(wants_symbol : Bool)

View source

Macros

gen_check_int_fits_in_size(type, method, size)

View source

gen_check_uint_fits_in_size(type, size)

View source