class Crystal::Lexer

Direct Known Subclasses

Defined in:

compiler/crystal/syntax/lexer.cr

Constructors

Class Method Summary

Macro Summary

Instance Method Summary

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) #

[View source]

Class Method Detail

def self.escape_forbidden_characters(string) #

used by the formatter


[View source]
def self.ident?(name) #

[View source]
def self.ident_part?(char) #

[View source]
def self.ident_start?(char) #

[View source]
def self.setter?(name) #

[View source]

Macro Detail

macro gen_check_int_fits_in_size(type, method, size, number_size, raw_number_string, start, pos_before_suffix, negative) #

[View source]

Instance Method Detail

def check_heredoc_end(delimiter_state) #

[View source]
def check_heredoc_start #

[View source]
def check_ident_or_keyword(keyword : Keyword, start) #

[View source]
def closing_char(char = current_char) #

[View source]
def column_number : Int32 #

[View source]
def column_number=(column_number : Int32) #

[View source]
def comments_enabled=(comments_enabled : Bool) #

[View source]
def comments_enabled? : Bool #

[View source]
def consume_braced_unicode_escape(allow_spaces = false) #

[View source]
def consume_char_unicode_escape #

[View source]
def consume_comment(start_pos) #

[View source]
def consume_doc #

[View source]
def consume_loc_pragma #

[View source]
def consume_newlines #

[View source]
def consume_non_braced_unicode_escape #

[View source]
def consume_octal_escape(char) #

[View source]
def consume_string_hex_escape #

[View source]
def consume_string_unicode_brace_escape #

[View source]
def consume_string_unicode_escape #

[View source]
def consume_whitespace #

[View source]
def count_whitespace=(count_whitespace : Bool) #

[View source]
def count_whitespace? : Bool #

[View source]
def current_char #

[View source]
def current_pos #

[View source]
def current_pos=(pos) #

[View source]
def delimited_pair(kind : Token::DelimiterKind, string_nest, string_end, start, allow_escapes = true) #

[View source]
def delimiter_state_for_percent_literal #

[View source]
def doc_enabled=(doc_enabled : Bool) #

[View source]
def doc_enabled? : Bool #

[View source]
def expected_hexadecimal_character_in_unicode_escape #

[View source]
def filename=(filename : Crystal::VirtualFile | String | Nil) #

[View source]
def handle_slash_r_slash_n_or_slash_n #

[View source]

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


[View source]
def ident_part_or_end?(char) #

[View source]
def incr_column_number(d = 1) #

[View source]
def incr_line_number(column_number = 1) #

[View source]
def line_number : Int32 #

[View source]
def line_number=(line_number : Int32) #

[View source]
def lookahead(preserve_token_on_fail = false, &) #

[View source]
def macro_expansion_pragmas : Hash(Int32, Array(LocPragma)) | Nil #

[View source]
def macro_expansion_pragmas=(macro_expansion_pragmas : Hash(Int32, Array(LocPragma)) | Nil) #

[View source]
def macro_starts_with_keyword?(beginning_of_line) : MacroKeywordState | Nil #

[View source]
def next_char(token_type : Token::Kind) #

[View source]
def next_char #

[View source]
def next_char_and_symbol(value) #

[View source]
def next_char_check_line #

[View source]
def next_char_no_column_increment #

[View source]
def next_macro_token(macro_state, skip_whitespace) #

[View source]
def next_string_array_token_noescape(delimiter_state) #

[View source]
def next_string_token(delimiter_state) #

[View source]
def next_string_token_noescape(delimiter_state) #

[View source]
def next_token #

[View source]
def next_token_never_a_symbol #

[View source]
def next_token_skip_space #

[View source]
def next_token_skip_space_or_newline #

[View source]
def next_token_skip_statement_end #

[View source]
def peek_ahead(&) #

[View source]
def peek_next_char #

[View source]
def peek_not_ident_part_or_end_next_char #

[View source]
def pop_location #

[View source]
def push_location #

[View source]
def raise(message, token : Token, size = nil) #

[View source]
def raise(message, location : Location) #

[View source]
def raise(message, line_number = @line_number, column_number = @column_number, filename = @filename) #

[View source]
def raise_unterminated_quoted(delimiter_state) #

[View source]
def raise_value_doesnt_fit_in(type, start, pos_before_suffix, alternative) #

[View source]
def raise_value_doesnt_fit_in(type, start, pos_before_suffix) #

[View source]
def reader : Char::Reader #

[View source]
def reset_token #

[View source]
def scan_ident(start) #

[View source]
def set_location(filename : Crystal::VirtualFile | String | Nil, line_number : Int32, column_number : Int32) #

[View source]
def set_token_raw_from_start(start) #

[View source]
def skip_comment #

[View source]
def skip_macro_whitespace #

[View source]
def skip_space #

[View source]
def skip_space_or_newline #

[View source]
def skip_statement_end #

[View source]
def slash_is_not_regex! #

[View source]
def slash_is_regex! #

[View source]
def slash_is_regex=(slash_is_regex : Bool) #

[View source]
def slash_is_regex? : Bool #

[View source]
def slice_range(start_pos, end_pos) #

[View source]
def slice_range(start_pos) #

[View source]
def string #

[View source]
def string_range(start_pos, end_pos) #

[View source]
def string_range(start_pos) #

[View source]
def string_range_from_pool(start_pos, end_pos) #

[View source]
def string_range_from_pool(start_pos) #

[View source]
def string_token_escape_value(value) #

[View source]
def symbol(value) #

[View source]
def token : Token #

[View source]
def token_end_location #

[View source]
def unknown_token #

[View source]
def wants_def_or_macro_name(&) #

[View source]
def wants_def_or_macro_name=(wants_def_or_macro_name : Bool) #

[View source]
def wants_def_or_macro_name? : Bool #

[View source]
def wants_raw=(wants_raw : Bool) #

[View source]
def wants_raw? : Bool #

[View source]
def wants_symbol : Bool #

[View source]
def wants_symbol=(wants_symbol : Bool) #

[View source]
def warn_large_uint64_literal(start, pos_before_suffix) #

[View source]
def warnings : WarningCollection #

Warning settings and all detected warnings.


[View source]
def warnings=(warnings : WarningCollection) #

Warning settings and all detected warnings.


[View source]