class Crystal::Parser

Defined in:

compiler/crystal/syntax/parser.cr

Constant Summary

AtomicWithMethodCheck = [:IDENT, :CONST, :OP_PLUS, :OP_MINUS, :OP_STAR, :OP_SLASH, :OP_SLASH_SLASH, :OP_PERCENT, :OP_BAR, :OP_AMP, :OP_CARET, :OP_TILDE, :OP_BANG, :OP_STAR_STAR, :OP_LT_LT, :OP_LT, :OP_LT_EQ, :OP_EQ_EQ, :OP_BANG_EQ, :OP_EQ_TILDE, :OP_BANG_TILDE, :OP_GT_GT, :OP_GT, :OP_GT_EQ, :OP_LT_EQ_GT, :OP_EQ_EQ_EQ, :OP_LSQUARE_RSQUARE, :OP_LSQUARE_RSQUARE_EQ, :OP_LSQUARE_RSQUARE_QUESTION, :OP_LSQUARE, :OP_AMP_PLUS, :OP_AMP_MINUS, :OP_AMP_STAR, :OP_AMP_STAR_STAR] of Token::Kind

IDENT CONST + - * / // % | & ^ ~ ! ** << < <= == != =~ !~ >> > >= <=> === [] []= []? [ &+ &- &* &**

ConstOrDoubleColon = [:CONST, :OP_COLON_COLON] of Token::Kind
DefOrMacroCheck1 = [:IDENT, :CONST, :OP_GRAVE, :OP_LT_LT, :OP_LT, :OP_LT_EQ, :OP_EQ_EQ, :OP_EQ_EQ_EQ, :OP_BANG_EQ, :OP_EQ_TILDE, :OP_BANG_TILDE, :OP_GT_GT, :OP_GT, :OP_GT_EQ, :OP_PLUS, :OP_MINUS, :OP_STAR, :OP_SLASH, :OP_SLASH_SLASH, :OP_BANG, :OP_TILDE, :OP_PERCENT, :OP_AMP, :OP_BAR, :OP_CARET, :OP_STAR_STAR, :OP_LSQUARE_RSQUARE, :OP_LSQUARE_RSQUARE_EQ, :OP_LSQUARE_RSQUARE_QUESTION, :OP_LT_EQ_GT, :OP_AMP_PLUS, :OP_AMP_MINUS, :OP_AMP_STAR, :OP_AMP_STAR_STAR] of Token::Kind

IDENT CONST ` << < <= == === != =~ !~ >> > >= + - * / // ! ~ % & | ^ ** [] []? []= <=> &+ &- &* &**

DefOrMacroCheck2 = [:OP_LT_LT, :OP_LT, :OP_LT_EQ, :OP_EQ_EQ, :OP_EQ_EQ_EQ, :OP_BANG_EQ, :OP_EQ_TILDE, :OP_BANG_TILDE, :OP_GT_GT, :OP_GT, :OP_GT_EQ, :OP_PLUS, :OP_MINUS, :OP_STAR, :OP_SLASH, :OP_SLASH_SLASH, :OP_BANG, :OP_TILDE, :OP_PERCENT, :OP_AMP, :OP_BAR, :OP_CARET, :OP_STAR_STAR, :OP_LSQUARE_RSQUARE, :OP_LSQUARE_RSQUARE_EQ, :OP_LSQUARE_RSQUARE_QUESTION, :OP_LT_EQ_GT, :OP_AMP_PLUS, :OP_AMP_MINUS, :OP_AMP_STAR, :OP_AMP_STAR_STAR] of Token::Kind

<< < <= == === != =~ !~ >> > >= + - * / // ! ~ % & | ^ ** [] []? []= <=> &+ &- &* &**

IdentOrConst = [:IDENT, :CONST] of Token::Kind
SemicolonOrNewLine = [:OP_SEMICOLON, :NEWLINE] of Token::Kind
StatementEnd = [:OP_SEMICOLON, :NEWLINE, :SPACE] of Token::Kind

Constructors

Class Method Summary

Macro Summary

Instance Method Summary

Instance methods inherited from class Crystal::Lexer

check_heredoc_end(delimiter_state) check_heredoc_end, check_heredoc_start check_heredoc_start, check_ident_or_keyword(keyword : Keyword, start) check_ident_or_keyword, closing_char(char = current_char) closing_char, column_number : Int32 column_number, column_number=(column_number : Int32) column_number=, comments_enabled=(comments_enabled : Bool) comments_enabled=, comments_enabled? : Bool comments_enabled?, consume_braced_unicode_escape(allow_spaces = false) consume_braced_unicode_escape, consume_char_unicode_escape consume_char_unicode_escape, consume_comment(start_pos) consume_comment, consume_doc consume_doc, consume_loc_pragma consume_loc_pragma, consume_newlines consume_newlines, consume_non_braced_unicode_escape consume_non_braced_unicode_escape, consume_octal_escape(char) consume_octal_escape, consume_string_hex_escape consume_string_hex_escape, consume_string_unicode_brace_escape consume_string_unicode_brace_escape, consume_string_unicode_escape consume_string_unicode_escape, consume_whitespace consume_whitespace, count_whitespace=(count_whitespace : Bool) count_whitespace=, count_whitespace? : Bool count_whitespace?, current_char current_char, current_pos current_pos, current_pos=(pos) current_pos=, delimited_pair(kind : Token::DelimiterKind, string_nest, string_end, start, allow_escapes = true) delimited_pair, delimiter_state_for_percent_literal delimiter_state_for_percent_literal, doc_enabled=(doc_enabled : Bool) doc_enabled=, doc_enabled? : Bool doc_enabled?, expected_hexadecimal_character_in_unicode_escape expected_hexadecimal_character_in_unicode_escape, filename=(filename : Crystal::VirtualFile | String | Nil) filename=, handle_slash_r_slash_n_or_slash_n handle_slash_r_slash_n_or_slash_n, heredocs : Array({Crystal::Token::DelimiterState, Crystal::Lexer::HeredocItem}) heredocs, ident_part_or_end?(char) ident_part_or_end?, incr_column_number(d = 1) incr_column_number, incr_line_number(column_number = 1) incr_line_number, line_number : Int32 line_number, line_number=(line_number : Int32) line_number=, lookahead(preserve_token_on_fail = false, &) lookahead, macro_expansion_pragmas : Hash(Int32, Array(LocPragma)) | Nil macro_expansion_pragmas, macro_expansion_pragmas=(macro_expansion_pragmas : Hash(Int32, Array(LocPragma)) | Nil) macro_expansion_pragmas=, macro_starts_with_keyword?(beginning_of_line) : MacroKeywordState | Nil macro_starts_with_keyword?, next_char(token_type : Token::Kind)
next_char
next_char
, next_char_and_symbol(value) next_char_and_symbol, next_char_check_line next_char_check_line, next_char_no_column_increment next_char_no_column_increment, next_macro_token(macro_state, skip_whitespace) next_macro_token, next_string_array_token_noescape(delimiter_state) next_string_array_token_noescape, next_string_token(delimiter_state) next_string_token, next_string_token_noescape(delimiter_state) next_string_token_noescape, next_token next_token, next_token_never_a_symbol next_token_never_a_symbol, next_token_skip_space next_token_skip_space, next_token_skip_space_or_newline next_token_skip_space_or_newline, next_token_skip_statement_end next_token_skip_statement_end, peek_ahead(&) peek_ahead, peek_next_char peek_next_char, peek_not_ident_part_or_end_next_char peek_not_ident_part_or_end_next_char, pop_location pop_location, push_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
, raise_unterminated_quoted(delimiter_state) raise_unterminated_quoted, raise_value_doesnt_fit_in(type, start, pos_before_suffix, alternative)
raise_value_doesnt_fit_in(type, start, pos_before_suffix)
raise_value_doesnt_fit_in
, reader : Char::Reader reader, reset_token reset_token, scan_ident(start) scan_ident, set_location(filename : Crystal::VirtualFile | String | Nil, line_number : Int32, column_number : Int32) set_location, set_token_raw_from_start(start) set_token_raw_from_start, skip_comment skip_comment, skip_macro_whitespace skip_macro_whitespace, skip_space skip_space, skip_space_or_newline skip_space_or_newline, skip_statement_end skip_statement_end, slash_is_not_regex! slash_is_not_regex!, slash_is_regex! slash_is_regex!, slash_is_regex=(slash_is_regex : Bool) slash_is_regex=, slash_is_regex? : Bool slash_is_regex?, slice_range(start_pos, end_pos)
slice_range(start_pos)
slice_range
, string string, string_range(start_pos, end_pos)
string_range(start_pos)
string_range
, string_range_from_pool(start_pos, end_pos)
string_range_from_pool(start_pos)
string_range_from_pool
, string_token_escape_value(value) string_token_escape_value, symbol(value) symbol, token : Token token, token_end_location token_end_location, unknown_token unknown_token, wants_def_or_macro_name(&) wants_def_or_macro_name, wants_def_or_macro_name=(wants_def_or_macro_name : Bool) wants_def_or_macro_name=, wants_def_or_macro_name? : Bool wants_def_or_macro_name?, wants_raw=(wants_raw : Bool) wants_raw=, wants_raw? : Bool wants_raw?, wants_symbol : Bool wants_symbol, wants_symbol=(wants_symbol : Bool) wants_symbol=, warn_large_uint64_literal(start, pos_before_suffix) warn_large_uint64_literal, warnings : WarningCollection warnings, warnings=(warnings : WarningCollection) warnings=

Constructor methods inherited from class Crystal::Lexer

new(string, string_pool : StringPool | Nil = nil, warnings : WarningCollection | Nil = nil) new

Class methods inherited from class Crystal::Lexer

escape_forbidden_characters(string) escape_forbidden_characters, ident?(name) ident?, ident_part?(char) ident_part?, ident_start?(char) ident_start?, setter?(name) setter?

Macros inherited from class Crystal::Lexer

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

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(str, string_pool : StringPool | Nil = nil, var_scopes : Array(Set(String)) = [Set(String).new], warnings : WarningCollection | Nil = nil) #

[View source]

Class Method Detail

def self.parse(str, string_pool : StringPool | Nil = nil, var_scopes = [Set(String).new]) : ASTNode #

[View source]

Macro Detail

macro parse_operator(name, next_operator, node, *operators, right_associative = false) #

[View source]

Instance Method Detail

def add_when_exp(when_exps, exp) #

Adds an expression to all when expressions and error on duplicates


[View source]
def call_block_arg_follows? #

[View source]
def can_be_assigned?(node) #

[View source]
def check(token_types : Array(Token::Kind)) #

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

[View source]
def check_const #

[View source]
def check_ident(value : Keyword) #

[View source]
def check_ident #

[View source]
def check_macro_expression_end #

[View source]
def check_macro_skip_whitespace #

[View source]
def check_not_inside_def(message, &) #

[View source]
def check_not_pipe_before_proc_literal_body #

[View source]
def check_type_declaration(&) #

[View source]
def check_valid_def_name #

[View source]
def check_valid_def_op_name #

[View source]
def check_valid_exhaustive_expression(exp) #

[View source]
def check_valid_param_name(token : Token = @token) #

[View source]
def check_void_expression_keyword #

[View source]
def check_void_value(exp, location) #

[View source]
def compute_block_arg_yields(block_arg) #

[View source]
def consume_def_equals_sign #

[View source]
def consume_def_equals_sign_skip_space #

[View source]
def consume_def_or_macro_name #

[View source]
def consume_delimiter(pieces, delimiter_state) #

[View source]
def consume_heredoc(delimiter_state, node) #

[View source]
def consume_heredocs #

[View source]
def consume_interpolation(delimiter_state) #

[View source]
def consume_regex_options #

[View source]
def def_nest : Int32 #

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

[View source]
def delimiter_or_type_suffix? #

[View source]
def end_token? #

[View source]
def fun_nest : Int32 #

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

[View source]
def inside_def? #

[View source]
def inside_fun? #

[View source]
def invalid_internal_name?(keyword) #

[View source]
def make_named_tuple_type(named_args) #

[View source]
def make_nilable_expression(type) #

[View source]
def make_nilable_type(type) #

[View source]
def make_pointer_type(type) #

[View source]
def make_static_array_type(type, size) #

[View source]
def make_tuple_type(types) #

[View source]
def multi_assign_left_hand(exp) #

[View source]
def multi_assign_middle?(exp) #

[View source]
def multi_assign_target?(exp) #

[View source]
def named_tuple_start? #

[View source]
def needs_heredoc_indent_removed?(delimiter_state) #

[View source]
def new_hash_literal(entries, line, column, end_location, allow_of = true) #

[View source]
def new_node_check_type_declaration(klass) #

[View source]
def new_range(exp, location, exclusive) #

[View source]
def next_comes_colon_space? #

[View source]
def next_comes_plus_or_minus? #

[View source]
def next_token #

[View source]
def node_and_next_token(node) #

[View source]
def open(symbol, location = @token.location, &) #

[View source]
def parse(mode : ParseMode) #

[View source]
def parse #

[View source]
def parse_add_or_sub #

[View source]
def parse_alias #

[View source]
def parse_alignof #

[View source]
def parse_and #

[View source]
def parse_annotation #

[View source]
def parse_annotation_def #

[View source]
def parse_array_literal #

[View source]
def parse_as(atomic, klass = Cast) #

[View source]
def parse_as?(atomic) #

[View source]
def parse_asm #

[View source]
def parse_asm_clobbers #

[View source]
def parse_asm_operand #

[View source]
def parse_asm_operands #

[View source]
def parse_asm_options #

[View source]
def parse_atomic #

[View source]
def parse_atomic_method_suffix(atomic, location) #

[View source]
def parse_atomic_method_suffix_special(call, location) #

[View source]
def parse_atomic_type #

[View source]
def parse_atomic_type_with_suffix #

[View source]
def parse_atomic_with_method #

[View source]
def parse_atomic_without_location #

[View source]
def parse_bare_proc_type #

Parse a bare proc type like A, B, C -> D. Generally it is entry point of type parsing and it is used on the context expected type (e.g. type restrictions, rhs of alias and more)


[View source]
def parse_begin #

[View source]
def parse_block(block, stop_on_do = false) #

[View source]
def parse_block2(&) #

[View source]
def parse_block_param(found_splat, all_names : Array(String)) #

[View source]
def parse_block_params(location) #

[View source]
def parse_break #

[View source]
def parse_c_struct_or_union(union : Bool) #

[View source]
def parse_c_struct_or_union_body #

[View source]
def parse_c_struct_or_union_fields(exps) #

[View source]
def parse_call_arg(found_double_splat = false) #

[View source]
def parse_call_args(stop_on_do_after_space = false, allow_curly = false, control = false) #

[View source]
def parse_call_args_named_args(location, args, first_name, allow_newline) #

[View source]
def parse_call_args_space_consumed(check_plus_and_minus = true, allow_curly = false, control = false, end_token : Token::Kind = :OP_RPAREN, allow_beginless_range = false) #

[View source]
def parse_call_block_arg(args, check_paren, named_args = nil) #

[View source]
def parse_call_block_arg_after_dot(obj) #

[View source]
def parse_case #

[View source]
def parse_class_def(is_abstract = false, is_struct = false, doc = nil) #

[View source]
def parse_cmp #

[View source]
def parse_control_expression(klass) #

[View source]
def parse_curly_block(block) #

[View source]
def parse_custom_literal(type) #

[View source]
def parse_def(is_abstract = false, is_macro_def = false, doc = nil) #

[View source]
def parse_def_block_param(extra_assigns, annotations : Array(Annotation) | Nil) #

[View source]
def parse_def_free_vars #

[View source]
def parse_def_helper(is_abstract = false) #

[View source]
def parse_delimiter(want_skip_space = true) #

[View source]
def parse_empty_array_literal #

[View source]
def parse_enum_body #

[View source]
def parse_enum_def #

[View source]
def parse_equality #

[View source]
def parse_exception_handler(exp, implicit = false, begin_location = nil) #

[View source]
def parse_expression #

[View source]
def parse_expression_inside_macro #

[View source]
def parse_expression_suffix(atomic, location) #

[View source]
def parse_expression_suffix(location, &) #

[View source]
def parse_expressions #

[View source]
def parse_expressions_internal #

[View source]
def parse_extend #

[View source]
def parse_fun_def(top_level, require_body = false) #

[View source]
def parse_fun_literal #

[View source]
def parse_fun_literal_param #

[View source]
def parse_fun_pointer #

[View source]
def parse_generic(global, location, expression) #

[View source]
def parse_generic(expression = false) #

Parse generic type path like A::B(C, D)?. This method is used to parse not only a type, but also an expression represents type. And it also consumes prefix :: to specify global path.


[View source]
def parse_generic_or_custom_literal #

[View source]
def parse_generic_or_global_call #

[View source]
def parse_hash_literal(first_key, location, allow_of) #

[View source]
def parse_hash_or_tuple_literal(allow_of = true) #

[View source]
def parse_if(check_end = true) #

[View source]
def parse_if_after_condition(cond, location, check_end) #

[View source]
def parse_include #

[View source]
def parse_include_or_extend(klass) #

[View source]
def parse_instance_alignof #

[View source]
def parse_instance_sizeof #

[View source]
def parse_is_a(atomic) #

[View source]
def parse_lib #

[View source]
def parse_lib_body #

[View source]
def parse_lib_body_exp #

[View source]
def parse_lib_body_exp_without_location #

[View source]
def parse_logical_and #

[View source]
def parse_logical_or #

[View source]
def parse_macro #

[View source]
def parse_macro_body(start_location, macro_state = Token::MacroState.default) #

[View source]
def parse_macro_control(start_location, macro_state = Token::MacroState.default) #

[View source]
def parse_macro_expression #

[View source]
def parse_macro_if(start_location, macro_state, check_end = true, is_unless = false) #

[View source]
def parse_macro_var_exps #

[View source]
def parse_module_def #

[View source]
def parse_mul_or_div #

[View source]
def parse_multi_assign #

[View source]
def parse_named_args(location, first_name = nil, allow_newline = false) #

[View source]
def parse_named_tuple(location, first_key) #

[View source]
def parse_named_tuple(location) #

[View source]
def parse_named_type_args(end_token : Token::Kind) #

[View source]
def parse_negation_suffix(atomic) #

[View source]
def parse_next #

[View source]
def parse_nil?(atomic) #

[View source]
def parse_offsetof #

[View source]
def parse_op_assign(allow_ops = true, allow_suffix = true) #

[View source]
def parse_op_assign_no_control(allow_ops = true, allow_suffix = true) #

[View source]
def parse_or #

[View source]
def parse_out #

[View source]
def parse_param(params, extra_assigns, parentheses, found_default_value, found_splat, found_double_splat, allow_restrictions) #

[View source]
def parse_param_name(location, extra_assigns, allow_external_name) #

[View source]
def parse_parenthesized_expression #

[View source]
def parse_path(global, location) #

[View source]
def parse_path #

Parse type path. It also consumes prefix :: to specify global path.


[View source]
def parse_percent_array_element(&) #

[View source]
def parse_percent_macro_control #

[View source]
def parse_percent_macro_expression #

[View source]
def parse_pointerof #

[View source]
def parse_pow #

[View source]
def parse_prefix #

[View source]
def parse_proc_type_output(input_types, location) #

[View source]
def parse_question_colon #

[View source]
def parse_range #

[View source]
def parse_read_instance_var(atomic) #

[View source]
def parse_require #

[View source]
def parse_rescue #

[View source]
def parse_rescue_types #

[View source]
def parse_responds_to(atomic) #

[View source]
def parse_responds_to_name #

[View source]
def parse_return #

[View source]
def parse_select #

[View source]
def parse_shift #

[View source]
def parse_single_arg #

[View source]
def parse_sizeof(klass) #

[View source]
def parse_sizeof #

[View source]
def parse_string_array #

[View source]
def parse_string_literal_without_interpolation(context, want_skip_space = true) #

[View source]
def parse_string_or_symbol_array_strings(&) #

[View source]
def parse_string_without_interpolation(context, want_skip_space = true) #

[View source]
def parse_symbol_array #

[View source]
def parse_to_def(a_def) #

[View source]
def parse_tuple(first_exp, location) #

[View source]
def parse_type_arg #

[View source]
def parse_type_args(name) #

[View source]
def parse_type_declaration(var) #

[View source]
def parse_type_def #

[View source]
def parse_type_splat(&) #

[View source]
def parse_type_suffix(type) #

[View source]
def parse_type_vars #

[View source]
def parse_typeof #

[View source]
def parse_union_type #

[View source]
def parse_union_types(end_token : Token::Kind, *, allow_splats = false) #

[View source]
def parse_unless #

[View source]
def parse_unless_after_condition(cond, location) #

[View source]
def parse_until #

[View source]
def parse_var_or_call(global = false, force_call = false, location = @token.location) #

[View source]
def parse_visibility_modifier(modifier) #

[View source]
def parse_when_expression(cond, single, exhaustive) #

[View source]
def parse_while #

[View source]
def parse_while_or_until(klass) #

[View source]
def parse_yield(scope = nil, location = @token.location) #

[View source]
def parse_yield_with_scope #

[View source]
def prepare_parse_def #

[View source]
def preserve_stop_on_do(new_value : Bool = false, &) #

[View source]
def push_block_vars(node) #

[View source]
def push_var(var : Var | Arg) #

[View source]
def push_var(var : TypeDeclaration) #

[View source]
def push_var(node) #

[View source]
def push_var_name(name) #

[View source]
def push_vars(vars) #

[View source]
def push_visibility(&) #

[View source]
def remove_heredoc_from_line(line, indent, line_number) #

[View source]
def remove_heredoc_indent(pieces : Array, indent) #

[View source]
def set_visibility(node) #

[View source]
def string_literal_start? #

[View source]
def temp_arg_name #

[View source]
def type_nest : Int32 #

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

[View source]
def type_path_start? #

[View source]
def type_start? #

[View source]
def type_start?(*, consume_newlines) #

Looks ahead next tokens to check whether they indicate type.


[View source]
def unexpected_token(msg : String | Nil = nil, token : Token = @token) #

[View source]
def unexpected_token_in_atomic #

[View source]
def valid_select_when?(node) #

[View source]
def var?(name) #

[View source]
def var_in_scope?(name) #

[View source]
def visibility : Visibility | Nil #

[View source]
def visibility=(visibility : Visibility | Nil) #

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

[View source]
def wants_doc? : Bool #

[View source]
def when_exp_constant?(exp) #

Only error on constant values, because calls might have side-effects: a first call might return one value and not match the case value, but the second same call returns something different and matches it.


[View source]
def when_expression_end #

[View source]
def with_isolated_var_scope(create_scope = true, &) #

If create_scope is true, creates an isolated variable scope and returns the yield result, resetting the scope afterwards. Otherwise simply returns the yield result without touching the scopes.


[View source]
def with_lexical_var_scope(&) #

Creates a new variable scope with the same variables as the current scope, and then returns the yield result, resetting the scope afterwards.


[View source]