class
Crystal::Lexer
Direct Known Subclasses
Defined in:
compiler/crystal/syntax/lexer.crConstructors
Class Method Summary
-
.escape_forbidden_characters(string)
used by the formatter
- .ident?(name)
- .ident_part?(char)
- .ident_start?(char)
- .setter?(name)
Macro Summary
Instance Method Summary
- #check_heredoc_end(delimiter_state)
- #check_heredoc_start
- #check_ident_or_keyword(keyword : Keyword, start)
- #closing_char(char = current_char)
- #column_number : Int32
- #column_number=(column_number : Int32)
- #comments_enabled=(comments_enabled : Bool)
- #comments_enabled? : Bool
- #consume_braced_unicode_escape(allow_spaces = false)
- #consume_char_unicode_escape
- #consume_comment(start_pos)
- #consume_doc
- #consume_loc_pragma
- #consume_newlines
- #consume_non_braced_unicode_escape
- #consume_octal_escape(char)
- #consume_string_hex_escape
- #consume_string_unicode_brace_escape
- #consume_string_unicode_escape
- #consume_whitespace
- #count_whitespace=(count_whitespace : Bool)
- #count_whitespace? : Bool
- #current_char
- #current_pos
- #current_pos=(pos)
- #delimited_pair(kind : Token::DelimiterKind, string_nest, string_end, start, allow_escapes = true)
- #delimiter_state_for_percent_literal
- #doc_enabled=(doc_enabled : Bool)
- #doc_enabled? : Bool
- #expected_hexadecimal_character_in_unicode_escape
- #filename=(filename : Crystal::VirtualFile | String | Nil)
- #handle_slash_r_slash_n_or_slash_n
-
#heredocs : Array({Crystal::Token::DelimiterState, Crystal::Lexer::HeredocItem})
Heredocs pushed when found.
- #ident_part_or_end?(char)
- #incr_column_number(d = 1)
- #incr_line_number(column_number = 1)
- #line_number : Int32
- #line_number=(line_number : Int32)
- #lookahead(preserve_token_on_fail = false, &)
- #macro_expansion_pragmas : Hash(Int32, Array(LocPragma)) | Nil
- #macro_expansion_pragmas=(macro_expansion_pragmas : Hash(Int32, Array(LocPragma)) | Nil)
- #macro_starts_with_keyword?(beginning_of_line) : MacroKeywordState | Nil
- #next_char(token_type : Token::Kind)
- #next_char
- #next_char_and_symbol(value)
- #next_char_check_line
- #next_char_no_column_increment
- #next_macro_token(macro_state, skip_whitespace)
- #next_string_array_token_noescape(delimiter_state)
- #next_string_token(delimiter_state)
- #next_string_token_noescape(delimiter_state)
- #next_token
- #next_token_never_a_symbol
- #next_token_skip_space
- #next_token_skip_space_or_newline
- #next_token_skip_statement_end
- #peek_ahead(&)
- #peek_next_char
- #peek_not_ident_part_or_end_next_char
- #pop_location
- #push_location
- #raise(message, token : Token, size = nil)
- #raise(message, location : Location)
- #raise(message, line_number = @line_number, column_number = @column_number, filename = @filename)
- #raise_unterminated_quoted(delimiter_state)
- #raise_value_doesnt_fit_in(type, start, pos_before_suffix, alternative)
- #raise_value_doesnt_fit_in(type, start, pos_before_suffix)
- #reader : Char::Reader
- #reset_token
- #scan_ident(start)
- #set_location(filename : Crystal::VirtualFile | String | Nil, line_number : Int32, column_number : Int32)
- #set_token_raw_from_start(start)
- #skip_comment
- #skip_macro_whitespace
- #skip_space
- #skip_space_or_newline
- #skip_statement_end
- #slash_is_not_regex!
- #slash_is_regex!
- #slash_is_regex=(slash_is_regex : Bool)
- #slash_is_regex? : Bool
- #slice_range(start_pos, end_pos)
- #slice_range(start_pos)
- #string
- #string_range(start_pos, end_pos)
- #string_range(start_pos)
- #string_range_from_pool(start_pos, end_pos)
- #string_range_from_pool(start_pos)
- #string_token_escape_value(value)
- #symbol(value)
- #token : Token
- #token_end_location
- #unknown_token
- #wants_def_or_macro_name(&)
- #wants_def_or_macro_name=(wants_def_or_macro_name : Bool)
- #wants_def_or_macro_name? : Bool
- #wants_raw=(wants_raw : Bool)
- #wants_raw? : Bool
- #wants_symbol : Bool
- #wants_symbol=(wants_symbol : Bool)
- #warn_large_uint64_literal(start, pos_before_suffix)
-
#warnings : WarningCollection
Warning settings and all detected warnings.
-
#warnings=(warnings : WarningCollection)
Warning settings and all detected warnings.
Instance methods inherited from class Reference
==(other : self)==(other : JSON::Any)
==(other : YAML::Any)
==(other) ==, dup dup, hash(hasher) hash, initialize initialize, inspect(io : IO) : Nil inspect, object_id : UInt64 object_id, pretty_print(pp) : Nil pretty_print, same?(other : Reference) : Bool
same?(other : Nil) same?, to_s(io : IO) : Nil to_s
Constructor methods inherited from class Reference
new
new,
unsafe_construct(address : Pointer, *args, **opts) : self
unsafe_construct
Class methods inherited from class Reference
pre_initialize(address : Pointer)
pre_initialize
Instance methods inherited from class Object
! : Bool
!,
!=(other)
!=,
!~(other)
!~,
==(other)
==,
===(other : JSON::Any)===(other : YAML::Any)
===(other) ===, =~(other) =~, as(type : Class) as, as?(type : Class) as?, class class, dup dup, hash(hasher)
hash hash, in?(collection : Object) : Bool
in?(*values : Object) : Bool in?, inspect(io : IO) : Nil
inspect : String inspect, is_a?(type : Class) : Bool is_a?, itself itself, nil? : Bool nil?, not_nil!(message)
not_nil! not_nil!, pretty_inspect(width = 79, newline = "\n", indent = 0) : String pretty_inspect, pretty_print(pp : PrettyPrint) : Nil pretty_print, responds_to?(name : Symbol) : Bool responds_to?, tap(&) tap, to_json(io : IO) : Nil
to_json : String to_json, to_pretty_json(indent : String = " ") : String
to_pretty_json(io : IO, indent : String = " ") : Nil to_pretty_json, to_s(io : IO) : Nil
to_s : String to_s, to_yaml(io : IO) : Nil
to_yaml : String to_yaml, try(&) try, unsafe_as(type : T.class) forall T unsafe_as
Class methods inherited from class Object
from_json(string_or_io : String | IO, root : String)from_json(string_or_io : String | IO) from_json, from_yaml(string_or_io : String | IO) from_yaml
Macros inherited from class Object
class_getter(*names, &block)
class_getter,
class_getter!(*names)
class_getter!,
class_getter?(*names, &block)
class_getter?,
class_property(*names, &block)
class_property,
class_property!(*names)
class_property!,
class_property?(*names, &block)
class_property?,
class_setter(*names)
class_setter,
def_clone
def_clone,
def_equals(*fields)
def_equals,
def_equals_and_hash(*fields)
def_equals_and_hash,
def_hash(*fields)
def_hash,
delegate(*methods, to object)
delegate,
forward_missing_to(delegate)
forward_missing_to,
getter(*names, &block)
getter,
getter!(*names)
getter!,
getter?(*names, &block)
getter?,
property(*names, &block)
property,
property!(*names)
property!,
property?(*names, &block)
property?,
setter(*names)
setter
Constructor Detail
def self.new(string, string_pool : StringPool | Nil = nil, warnings : WarningCollection | Nil = nil)
#
Class Method Detail
Macro Detail
macro gen_check_int_fits_in_size(type, method, size, number_size, raw_number_string, start, pos_before_suffix, negative)
#
Instance Method Detail
def delimited_pair(kind : Token::DelimiterKind, string_nest, string_end, start, allow_escapes = true)
#
Heredocs pushed when found. Should be processed when encountering a newline
def raise(message, line_number = @line_number, column_number = @column_number, filename = @filename)
#
def set_location(filename : Crystal::VirtualFile | String | Nil, line_number : Int32, column_number : Int32)
#