|
Ruby
2.1.3p242(2014-09-19revision47630)
|
#include "ruby/ruby.h"#include "ruby/st.h"#include "ruby/encoding.h"#include "internal.h"#include "node.h"#include "parse.h"#include "id.h"#include "regenc.h"#include <stdio.h>#include <errno.h>#include <ctype.h>#include "probes.h"#include "id.c"#include "ruby/regex.h"#include "ruby/util.h"#include "lex.c"
Go to the source code of this file.
Macros | |
| #define | PARSER_DEBUG 0 |
| #define | YYDEBUG 1 |
| #define | YYERROR_VERBOSE 1 |
| #define | YYSTACK_USE_ALLOCA 0 |
| #define | YYMALLOC(size) rb_parser_malloc(parser, (size)) |
| #define | YYREALLOC(ptr, size) rb_parser_realloc(parser, (ptr), (size)) |
| #define | YYCALLOC(nelem, size) rb_parser_calloc(parser, (nelem), (size)) |
| #define | YYFREE(ptr) rb_parser_free(parser, (ptr)) |
| #define | malloc YYMALLOC |
| #define | realloc YYREALLOC |
| #define | calloc YYCALLOC |
| #define | free YYFREE |
| #define | REGISTER_SYMID(id, name) register_symid((id), (name), strlen(name), enc) |
| #define | is_notop_id(id) ((id)>tLAST_OP_ID) |
| #define | is_local_id(id) (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_LOCAL) |
| #define | is_global_id(id) (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_GLOBAL) |
| #define | is_instance_id(id) (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_INSTANCE) |
| #define | is_attrset_id(id) (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_ATTRSET) |
| #define | is_const_id(id) (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_CONST) |
| #define | is_class_id(id) (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_CLASS) |
| #define | is_junk_id(id) (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_JUNK) |
| #define | id_type(id) (is_notop_id(id) ? (int)((id)&ID_SCOPE_MASK) : -1) |
| #define | is_asgn_or_id(id) |
| #define | DEF_EXPR(n) EXPR_##n = (1 << EXPR_##n##_bit) |
| #define | IS_lex_state_for(x, ls) ((x) & (ls)) |
| #define | IS_lex_state(ls) IS_lex_state_for(lex_state, (ls)) |
| #define | BITSTACK_PUSH(stack, n) ((stack) = ((stack)<<1)|((n)&1)) |
| #define | BITSTACK_POP(stack) ((stack) = (stack) >> 1) |
| #define | BITSTACK_LEXPOP(stack) ((stack) = ((stack) >> 1) | ((stack) & 1)) |
| #define | BITSTACK_SET_P(stack) ((stack)&1) |
| #define | COND_PUSH(n) BITSTACK_PUSH(cond_stack, (n)) |
| #define | COND_POP() BITSTACK_POP(cond_stack) |
| #define | COND_LEXPOP() BITSTACK_LEXPOP(cond_stack) |
| #define | COND_P() BITSTACK_SET_P(cond_stack) |
| #define | CMDARG_PUSH(n) BITSTACK_PUSH(cmdarg_stack, (n)) |
| #define | CMDARG_POP() BITSTACK_POP(cmdarg_stack) |
| #define | CMDARG_LEXPOP() BITSTACK_LEXPOP(cmdarg_stack) |
| #define | CMDARG_P() BITSTACK_SET_P(cmdarg_stack) |
| #define | DVARS_INHERIT ((void*)1) |
| #define | DVARS_TOPSCOPE NULL |
| #define | DVARS_SPECIAL_P(tbl) (!POINTER_P(tbl)) |
| #define | POINTER_P(val) ((VALUE)(val) & ~(VALUE)3) |
| #define | VTBL_DEBUG 0 |
| #define | STR_NEW(p, n) rb_enc_str_new((p),(n),current_enc) |
| #define | STR_NEW0() rb_enc_str_new(0,0,current_enc) |
| #define | STR_NEW2(p) rb_enc_str_new((p),strlen(p),current_enc) |
| #define | STR_NEW3(p, n, e, func) parser_str_new((p),(n),(e),(func),current_enc) |
| #define | ENC_SINGLE(cr) ((cr)==ENC_CODERANGE_7BIT) |
| #define | TOK_INTERN(mb) rb_intern3(tok(), toklen(), current_enc) |
| #define | yyerror(msg) parser_yyerror(parser, (msg)) |
| #define | lex_strterm (parser->parser_lex_strterm) |
| #define | lex_state (parser->parser_lex_state) |
| #define | cond_stack (parser->parser_cond_stack) |
| #define | cmdarg_stack (parser->parser_cmdarg_stack) |
| #define | class_nest (parser->parser_class_nest) |
| #define | paren_nest (parser->parser_paren_nest) |
| #define | lpar_beg (parser->parser_lpar_beg) |
| #define | brace_nest (parser->parser_brace_nest) |
| #define | in_single (parser->parser_in_single) |
| #define | in_def (parser->parser_in_def) |
| #define | compile_for_eval (parser->parser_compile_for_eval) |
| #define | cur_mid (parser->parser_cur_mid) |
| #define | in_defined (parser->parser_in_defined) |
| #define | tokenbuf (parser->parser_tokenbuf) |
| #define | tokidx (parser->parser_tokidx) |
| #define | toksiz (parser->parser_toksiz) |
| #define | tokline (parser->parser_tokline) |
| #define | lex_input (parser->parser_lex_input) |
| #define | lex_lastline (parser->parser_lex_lastline) |
| #define | lex_nextline (parser->parser_lex_nextline) |
| #define | lex_pbeg (parser->parser_lex_pbeg) |
| #define | lex_p (parser->parser_lex_p) |
| #define | lex_pend (parser->parser_lex_pend) |
| #define | heredoc_end (parser->parser_heredoc_end) |
| #define | command_start (parser->parser_command_start) |
| #define | deferred_nodes (parser->parser_deferred_nodes) |
| #define | lex_gets_ptr (parser->parser_lex_gets_ptr) |
| #define | lex_gets (parser->parser_lex_gets) |
| #define | lvtbl (parser->parser_lvtbl) |
| #define | ruby__end__seen (parser->parser_ruby__end__seen) |
| #define | ruby_sourceline (parser->parser_ruby_sourceline) |
| #define | ruby_sourcefile (parser->parser_ruby_sourcefile) |
| #define | ruby_sourcefile_string (parser->parser_ruby_sourcefile_string) |
| #define | current_enc (parser->enc) |
| #define | yydebug (parser->parser_yydebug) |
| #define | ruby_eval_tree (parser->parser_eval_tree) |
| #define | ruby_eval_tree_begin (parser->parser_eval_tree_begin) |
| #define | ruby_debug_lines (parser->debug_lines) |
| #define | ruby_coverage (parser->coverage) |
| #define | yyparse ruby_yyparse |
| #define | rb_node_newnode(type, a1, a2, a3) node_newnode(parser, (type), (a1), (a2), (a3)) |
| #define | cond(node) cond_gen(parser, (node)) |
| #define | logop(type, node1, node2) logop_gen(parser, (type), (node1), (node2)) |
| #define | value_expr(node) value_expr_gen(parser, (node) = remove_begin(node)) |
| #define | void_expr0(node) void_expr_gen(parser, (node)) |
| #define | void_expr(node) void_expr0((node) = remove_begin(node)) |
| #define | void_stmts(node) void_stmts_gen(parser, (node)) |
| #define | reduce_nodes(n) reduce_nodes_gen(parser,(n)) |
| #define | block_dup_check(n1, n2) block_dup_check_gen(parser,(n1),(n2)) |
| #define | block_append(h, t) block_append_gen(parser,(h),(t)) |
| #define | list_append(l, i) list_append_gen(parser,(l),(i)) |
| #define | list_concat(h, t) list_concat_gen(parser,(h),(t)) |
| #define | arg_append(h, t) arg_append_gen(parser,(h),(t)) |
| #define | arg_concat(h, t) arg_concat_gen(parser,(h),(t)) |
| #define | literal_concat(h, t) literal_concat_gen(parser,(h),(t)) |
| #define | new_evstr(n) new_evstr_gen(parser,(n)) |
| #define | evstr2dstr(n) evstr2dstr_gen(parser,(n)) |
| #define | call_bin_op(recv, id, arg1) call_bin_op_gen(parser, (recv),(id),(arg1)) |
| #define | call_uni_op(recv, id) call_uni_op_gen(parser, (recv),(id)) |
| #define | new_args(f, o, r, p, t) new_args_gen(parser, (f),(o),(r),(p),(t)) |
| #define | new_args_tail(k, kr, b) new_args_tail_gen(parser, (k),(kr),(b)) |
| #define | ret_args(node) ret_args_gen(parser, (node)) |
| #define | new_yield(node) new_yield_gen(parser, (node)) |
| #define | dsym_node(node) dsym_node_gen(parser, (node)) |
| #define | gettable(id) gettable_gen(parser,(id)) |
| #define | assignable(id, node) assignable_gen(parser, (id), (node)) |
| #define | aryset(node1, node2) aryset_gen(parser, (node1), (node2)) |
| #define | attrset(node, id) attrset_gen(parser, (node), (id)) |
| #define | rb_backref_error(n) rb_backref_error_gen(parser,(n)) |
| #define | node_assign(node1, node2) node_assign_gen(parser, (node1), (node2)) |
| #define | new_attr_op_assign(lhs, type, attr, op, rhs) new_attr_op_assign_gen(parser, (lhs), (attr), (op), (rhs)) |
| #define | new_const_op_assign(lhs, op, rhs) new_const_op_assign_gen(parser, (lhs), (op), (rhs)) |
| #define | new_defined(expr) NEW_DEFINED(remove_begin_all(expr)) |
| #define | match_op(node1, node2) match_op_gen(parser, (node1), (node2)) |
| #define | local_tbl() local_tbl_gen(parser) |
| #define | reg_compile(str, options) reg_compile_gen(parser, (str), (options)) |
| #define | reg_fragment_setenc(str, options) reg_fragment_setenc_gen(parser, (str), (options)) |
| #define | reg_fragment_check(str, options) reg_fragment_check_gen(parser, (str), (options)) |
| #define | reg_named_capture_assign(regexp, match) reg_named_capture_assign_gen(parser,(regexp),(match)) |
| #define | get_id(id) (id) |
| #define | get_value(val) (val) |
| #define | new_op_assign(lhs, op, rhs) new_op_assign_gen(parser, (lhs), (op), (rhs)) |
| #define | formal_argument(id) formal_argument_gen(parser, (id)) |
| #define | shadowing_lvar(name) shadowing_lvar_gen(parser, (name)) |
| #define | new_bv(id) new_bv_gen(parser, (id)) |
| #define | local_push(top) local_push_gen(parser,(top)) |
| #define | local_pop() local_pop_gen(parser) |
| #define | local_var(id) local_var_gen(parser, (id)) |
| #define | arg_var(id) arg_var_gen(parser, (id)) |
| #define | local_id(id) local_id_gen(parser, (id)) |
| #define | internal_id() internal_id_gen(parser) |
| #define | dyna_push() dyna_push_gen(parser) |
| #define | dyna_pop(node) dyna_pop_gen(parser, (node)) |
| #define | dyna_in_block() dyna_in_block_gen(parser) |
| #define | dyna_var(id) local_var(id) |
| #define | dvar_defined(id) dvar_defined_gen(parser, (id), 0) |
| #define | dvar_defined_get(id) dvar_defined_gen(parser, (id), 1) |
| #define | dvar_curr(id) dvar_curr_gen(parser, (id)) |
| #define | lvar_defined(id) lvar_defined_gen(parser, (id)) |
| #define | RE_OPTION_ONCE (1<<16) |
| #define | RE_OPTION_ENCODING_SHIFT 8 |
| #define | RE_OPTION_ENCODING(e) (((e)&0xff)<<RE_OPTION_ENCODING_SHIFT) |
| #define | RE_OPTION_ENCODING_IDX(o) (((o)>>RE_OPTION_ENCODING_SHIFT)&0xff) |
| #define | RE_OPTION_ENCODING_NONE(o) ((o)&RE_OPTION_ARG_ENCODING_NONE) |
| #define | RE_OPTION_MASK 0xff |
| #define | RE_OPTION_ARG_ENCODING_NONE 32 |
| #define | NODE_STRTERM NODE_ZARRAY /* nothing to gc */ |
| #define | NODE_HEREDOC NODE_ARRAY /* 1, 3 to gc */ |
| #define | SIGN_EXTEND(x, n) (((1<<(n)-1)^((x)&~(~0<<(n))))-(1<<(n)-1)) |
| #define | nd_func u1.id |
| #define | nd_term(node) SIGN_EXTEND((node)->u2.id, CHAR_BIT*2) |
| #define | nd_paren(node) (char)((node)->u2.id >> CHAR_BIT*2) |
| #define | nd_nest u3.cnt |
| #define | Qnone 0 |
| #define | ifndef_ripper(x) (x) |
| #define | rb_warn0(fmt) rb_compile_warn(ruby_sourcefile, ruby_sourceline, (fmt)) |
| #define | rb_warnI(fmt, a) rb_compile_warn(ruby_sourcefile, ruby_sourceline, (fmt), (a)) |
| #define | rb_warnS(fmt, a) rb_compile_warn(ruby_sourcefile, ruby_sourceline, (fmt), (a)) |
| #define | rb_warn4S(file, line, fmt, a) rb_compile_warn((file), (line), (fmt), (a)) |
| #define | rb_warning0(fmt) rb_compile_warning(ruby_sourcefile, ruby_sourceline, (fmt)) |
| #define | rb_warningS(fmt, a) rb_compile_warning(ruby_sourcefile, ruby_sourceline, (fmt), (a)) |
| #define | rb_compile_error rb_compile_error_with_enc |
| #define | compile_error parser->nerr++,rb_compile_error_with_enc |
| #define | PARSER_ARG ruby_sourcefile, ruby_sourceline, current_enc, |
| #define | token_info_push(token) (RTEST(ruby_verbose) ? token_info_push(parser, (token)) : (void)0) |
| #define | token_info_pop(token) (RTEST(ruby_verbose) ? token_info_pop(parser, (token)) : (void)0) |
| #define | yylval (*((YYSTYPE*)(parser->parser_yylval))) |
| #define | nextc() parser_nextc(parser) |
| #define | pushback(c) parser_pushback(parser, (c)) |
| #define | newtok() parser_newtok(parser) |
| #define | tokspace(n) parser_tokspace(parser, (n)) |
| #define | tokadd(c) parser_tokadd(parser, (c)) |
| #define | tok_hex(numlen) parser_tok_hex(parser, (numlen)) |
| #define | read_escape(flags, e) parser_read_escape(parser, (flags), (e)) |
| #define | tokadd_escape(e) parser_tokadd_escape(parser, (e)) |
| #define | regx_options() parser_regx_options(parser) |
| #define | tokadd_string(f, t, p, n, e) parser_tokadd_string(parser,(f),(t),(p),(n),(e)) |
| #define | parse_string(n) parser_parse_string(parser,(n)) |
| #define | tokaddmbc(c, enc) parser_tokaddmbc(parser, (c), (enc)) |
| #define | here_document(n) parser_here_document(parser,(n)) |
| #define | heredoc_identifier() parser_heredoc_identifier(parser) |
| #define | heredoc_restore(n) parser_heredoc_restore(parser,(n)) |
| #define | whole_match_p(e, l, i) parser_whole_match_p(parser,(e),(l),(i)) |
| #define | number_literal_suffix(f) parser_number_literal_suffix(parser, (f)) |
| #define | set_number_literal(v, t, f) parser_set_number_literal(parser, (v), (t), (f)) |
| #define | set_integer_literal(v, f) parser_set_integer_literal(parser, (v), (f)) |
| #define | set_yylval_str(x) (yylval.node = NEW_STR(x)) |
| #define | set_yylval_num(x) (yylval.num = (x)) |
| #define | set_yylval_id(x) (yylval.id = (x)) |
| #define | set_yylval_name(x) (yylval.id = (x)) |
| #define | set_yylval_literal(x) (yylval.node = NEW_LIT(x)) |
| #define | set_yylval_node(x) (yylval.node = (x)) |
| #define | yylval_id() (yylval.id) |
| #define | ripper_flush(p) (void)(p) |
| #define | SIGN_EXTEND_CHAR(c) ((((unsigned char)(c)) ^ 128) - 128) |
| #define | parser_encoding_name() (current_enc->name) |
| #define | parser_mbclen() mbclen((lex_p-1),lex_pend,current_enc) |
| #define | parser_precise_mbclen() rb_enc_precise_mbclen((lex_p-1),lex_pend,current_enc) |
| #define | is_identchar(p, e, enc) (rb_enc_isalnum((unsigned char)(*(p)),(enc)) || (*(p)) == '_' || !ISASCII(*(p))) |
| #define | parser_is_identchar() (!parser->eofp && is_identchar((lex_p-1),lex_pend,current_enc)) |
| #define | parser_isascii() ISASCII(*(lex_p-1)) |
| #define | STR_FUNC_ESCAPE 0x01 |
| #define | STR_FUNC_EXPAND 0x02 |
| #define | STR_FUNC_REGEXP 0x04 |
| #define | STR_FUNC_QWORDS 0x08 |
| #define | STR_FUNC_SYMBOL 0x10 |
| #define | STR_FUNC_INDENT 0x20 |
| #define | lex_goto_eol(parser) ((parser)->parser_lex_p = (parser)->parser_lex_pend) |
| #define | lex_eol_p() (lex_p >= lex_pend) |
| #define | peek(c) peek_n((c), 0) |
| #define | peek_n(c, n) (lex_p+(n) < lex_pend && (c) == (unsigned char)lex_p[n]) |
| #define | was_bol() (lex_p == lex_pbeg + 1) |
| #define | tokfix() (tokenbuf[tokidx]='\0') |
| #define | tok() tokenbuf |
| #define | toklen() tokidx |
| #define | toklast() (tokidx>0?tokenbuf[tokidx-1]:0) |
| #define | tokcopy(n) memcpy(tokspace(n), lex_p - (n), (n)) |
| #define | ESCAPE_CONTROL 1 |
| #define | ESCAPE_META 2 |
| #define | tokadd_mbchar(c) parser_tokadd_mbchar(parser, (c)) |
| #define | mixed_error(enc1, enc2) |
| #define | mixed_escape(beg, enc1, enc2) |
| #define | NEW_STRTERM(func, term, paren) rb_node_newnode(NODE_STRTERM, (func), (term) | ((paren) << (CHAR_BIT * 2)), 0) |
| #define | flush_string_content(enc) ((void)(enc)) |
| #define | BIT(c, idx) (((c) / 32 - 1 == idx) ? (1U << ((c) % 32)) : 0) |
| #define | SPECIAL_PUNCT(idx) |
| #define | NUM_SUFFIX_R (1<<0) |
| #define | NUM_SUFFIX_I (1<<1) |
| #define | NUM_SUFFIX_ALL 3 |
| #define | dispatch_heredoc_end() ((void)0) |
| #define | arg_ambiguous() (arg_ambiguous_gen(parser), 1) |
| #define | str_copy(_s, _p, _n) |
| #define | IS_ARG() IS_lex_state(EXPR_ARG_ANY) |
| #define | IS_END() IS_lex_state(EXPR_END_ANY) |
| #define | IS_BEG() IS_lex_state(EXPR_BEG_ANY) |
| #define | IS_SPCARG(c) (IS_ARG() && space_seen && !ISSPACE(c)) |
| #define | IS_LABEL_POSSIBLE() ((IS_lex_state(EXPR_BEG | EXPR_ENDFN) && !cmd_state) || IS_ARG()) |
| #define | IS_LABEL_SUFFIX(n) (peek_n(':',(n)) && !peek_n(':', (n)+1)) |
| #define | IS_AFTER_OPERATOR() IS_lex_state(EXPR_FNAME | EXPR_DOT) |
| #define | ambiguous_operator(op, syn) |
| #define | warn_balanced(op, syn) |
| #define | no_digits() do {yyerror("numeric literal without digits"); return 0;} while (0) |
| #define | parser_warning(node, mesg) parser_warning(parser, (node), (mesg)) |
| #define | parser_warn(node, mesg) parser_warn(parser, (node), (mesg)) |
| #define | assignable_result(x) (x) |
| #define | LVAR_USED ((ID)1 << (sizeof(ID) * CHAR_BIT - 1)) |
| #define | subnodes(n1, n2) |
| #define | op_tbl_count numberof(op_tbl) |
| #define | ENABLE_SELECTOR_NAMESPACE 0 |
| #define | IDSET_ATTRSET_FOR_SYNTAX ((1U<<ID_LOCAL)|(1U<<ID_CONST)) |
| #define | IDSET_ATTRSET_FOR_INTERN (~(~0U<<ID_SCOPE_MASK) & ~(1U<<ID_ATTRSET)) |
| #define | HEAPCNT(n, size) ((n) * (size) / sizeof(YYSTYPE)) |
| #define | NEWHEAP() rb_node_newnode(NODE_ALLOCA, 0, (VALUE)parser->heap, 0) |
| #define | ADD2HEAP(n, c, p) |
Typedefs | |
| typedef VALUE | stack_type |
| typedef struct token_info | token_info |
Variables | |
| primary_value['opt_call_args rbracket{$$=aryset($1, $3);}|primary_value '.'tIDENTIFIER{$$=attrset($1, $3);}|primary_value tCOLON2 tIDENTIFIER{$$=attrset($1, $3);}|primary_value '.'tCONSTANT{$$=attrset($1, $3);}|primary_value tCOLON2 tCONSTANT{if(in_def||in_single) yyerror("dynamic constant assignment");$$=NEW_CDECL(0, 0, NEW_COLON2($1, $3));}|tCOLON3 tCONSTANT{if(in_def||in_single) yyerror("dynamic constant assignment");$$=NEW_CDECL(0, 0, NEW_COLON3($2));}|backref{rb_backref_error($1);$$=NEW_BEGIN(0);};lhs:user_variable{$$=assignable($1, 0);if(!$$)$$=NEW_BEGIN(0);}|keyword_variable{$$=assignable($1, 0);if(!$$)$$=NEW_BEGIN(0);}|primary_value '['opt_call_args rbracket{$$=aryset($1, $3);}|primary_value '.'tIDENTIFIER{$$=attrset($1, $3);}|primary_value tCOLON2 tIDENTIFIER{$$=attrset($1, $3);}|primary_value '.'tCONSTANT{$$=attrset($1, $3);}|primary_value tCOLON2 tCONSTANT{if(in_def||in_single) yyerror("dynamic constant assignment");$$=NEW_CDECL(0, 0, NEW_COLON2($1, $3));}|tCOLON3 tCONSTANT{if(in_def||in_single) yyerror("dynamic constant assignment");$$=NEW_CDECL(0, 0, NEW_COLON3($2));}|backref{rb_backref_error($1);$$=NEW_BEGIN(0);};cname:tIDENTIFIER{yyerror("class/module name must be CONSTANT");}|tCONSTANT;cpath:tCOLON3 cname{$$=NEW_COLON3($2);}|cname{$$=NEW_COLON2(0,$$);}|primary_value tCOLON2 cname{$$=NEW_COLON2($1, $3);};fname:tIDENTIFIER|tCONSTANT|tFID|op{lex_state=EXPR_ENDFN;$$=$1;}|reswords{lex_state=EXPR_ENDFN;$$=$ < id >1;};fsym:fname|symbol;fitem:fsym{$$=NEW_LIT(ID2SYM($1));}|dsym;undef_list:fitem{$$=NEW_UNDEF($1);}|undef_list ','{lex_state=EXPR_FNAME;}fitem{$$=block_append($1, NEW_UNDEF($4));};op: '|'{ifndef_ripper($$= '|');}| '^'{ifndef_ripper($$= '^');}| '&'{ifndef_ripper($$= '&');}|tCMP{ifndef_ripper($$=tCMP);}|tEQ{ifndef_ripper($$=tEQ);}|tEQQ{ifndef_ripper($$=tEQQ);}|tMATCH{ifndef_ripper($$=tMATCH);}|tNMATCH{ifndef_ripper($$=tNMATCH);}| '> '{ifndef_ripper($$= '> ');}|tGEQ{ifndef_ripper($$=tGEQ);}| ' <'{ifndef_ripper($$= ' <');}|tLEQ{ifndef_ripper($$=tLEQ);}|tNEQ{ifndef_ripper($$=tNEQ);}|tLSHFT{ifndef_ripper($$=tLSHFT);}|tRSHFT{ifndef_ripper($$=tRSHFT);}| '+'{ifndef_ripper($$= '+');}| '-'{ifndef_ripper($$= '-');}| '*'{ifndef_ripper($$= '*');}|tSTAR{ifndef_ripper($$= '*');}| '/'{ifndef_ripper($$= '/');}| '%'{ifndef_ripper($$= '%');}|tPOW{ifndef_ripper($$=tPOW);}|tDSTAR{ifndef_ripper($$=tDSTAR);}| '!'{ifndef_ripper($$= '!');}| '~'{ifndef_ripper($$= '~');}|tUPLUS{ifndef_ripper($$=tUPLUS);}|tUMINUS{ifndef_ripper($$=tUMINUS);}|tAREF{ifndef_ripper($$=tAREF);}|tASET{ifndef_ripper($$=tASET);}| '`'{ifndef_ripper($$= '`');};reswords:keyword__LINE__|keyword__FILE__|keyword__ENCODING__|keyword_BEGIN|keyword_END|keyword_alias|keyword_and|keyword_begin|keyword_break|keyword_case|keyword_class|keyword_def|keyword_defined|keyword_do|keyword_else|keyword_elsif|keyword_end|keyword_ensure|keyword_false|keyword_for|keyword_in|keyword_module|keyword_next|keyword_nil|keyword_not|keyword_or|keyword_redo|keyword_rescue|keyword_retry|keyword_return|keyword_self|keyword_super|keyword_then|keyword_true|keyword_undef|keyword_when|keyword_yield|keyword_if|keyword_unless|keyword_while|keyword_until;arg:lhs '='arg{value_expr($3);$$=node_assign($1, $3);}|lhs '='arg modifier_rescue arg{value_expr($3);$3=NEW_RESCUE($3, NEW_RESBODY(0, $5, 0), 0);$$=node_assign($1, $3);}|var_lhs tOP_ASGN arg{value_expr($3);$$=new_op_assign($1, $2, $3);}|var_lhs tOP_ASGN arg modifier_rescue arg{value_expr($3);$3=NEW_RESCUE($3, NEW_RESBODY(0, $5, 0), 0);$$=new_op_assign($1, $2, $3);}|primary_value '['opt_call_args rbracket tOP_ASGN arg{NODE *args;value_expr($6);if(!$3) $3=NEW_ZARRAY();if(nd_type($3)==NODE_BLOCK_PASS){args=NEW_ARGSCAT($3, $6);}else{args=arg_concat($3, $6);}if($5==tOROP){$5=0;}else if($5==tANDOP){$5=1;}$$=NEW_OP_ASGN1($1, $5, args);fixpos($$, $1);}|primary_value '.'tIDENTIFIER tOP_ASGN arg{value_expr($5);$$=new_attr_op_assign($1, ripper_id2sym('.'), $3, $4, $5);}|primary_value '.'tCONSTANT tOP_ASGN arg{value_expr($5);$$=new_attr_op_assign($1, ripper_id2sym('.'), $3, $4, $5);}|primary_value tCOLON2 tIDENTIFIER tOP_ASGN arg{value_expr($5);$$=new_attr_op_assign($1, ripper_intern("::"), $3, $4, $5);}|primary_value tCOLON2 tCONSTANT tOP_ASGN arg{$$=NEW_COLON2($1, $3);$$=new_const_op_assign($$, $4, $5);}|tCOLON3 tCONSTANT tOP_ASGN arg{$$=NEW_COLON3($2);$$=new_const_op_assign($$, $3, $4);}|backref tOP_ASGN arg{rb_backref_error($1);$$=NEW_BEGIN(0);}|arg tDOT2 arg{value_expr($1);value_expr($3);$$=NEW_DOT2($1, $3);if(nd_type($1)==NODE_LIT &&FIXNUM_P($1->nd_lit)&&nd_type($3)==NODE_LIT &&FIXNUM_P($3->nd_lit)){deferred_nodes=list_append(deferred_nodes,$$);}}|arg tDOT3 arg{value_expr($1);value_expr($3);$$=NEW_DOT3($1, $3);if(nd_type($1)==NODE_LIT &&FIXNUM_P($1->nd_lit)&&nd_type($3)==NODE_LIT &&FIXNUM_P($3->nd_lit)){deferred_nodes=list_append(deferred_nodes,$$);}}|arg '+'arg{$$=call_bin_op($1, '+', $3);}|arg '-'arg{$$=call_bin_op($1, '-', $3);}|arg '*'arg{$$=call_bin_op($1, '*', $3);}|arg '/'arg{$$=call_bin_op($1, '/', $3);}|arg '%'arg{$$=call_bin_op($1, '%', $3);}|arg tPOW arg{$$=call_bin_op($1, tPOW, $3);}|tUMINUS_NUM simple_numeric tPOW arg{$$=NEW_CALL(call_bin_op($2, tPOW, $4), tUMINUS, 0);}|tUPLUS arg{$$=call_uni_op($2, tUPLUS);}|tUMINUS arg{$$=call_uni_op($2, tUMINUS);}|arg '|'arg{$$=call_bin_op($1, '|', $3);}|arg '^'arg{$$=call_bin_op($1, '^', $3);}|arg '&'arg{$$=call_bin_op($1, '&', $3);}|arg tCMP arg{$$=call_bin_op($1, tCMP, $3);}|arg '>'arg{$$=call_bin_op($1, '> ', $3);}|arg tGEQ arg{$$=call_bin_op($1, tGEQ, $3);}|arg '<'arg{$$=call_bin_op($1, ' <', $3);}|arg tLEQ arg{$$=call_bin_op($1, tLEQ, $3);}|arg tEQ arg{$$=call_bin_op($1, tEQ, $3);}|arg tEQQ arg{$$=call_bin_op($1, tEQQ, $3);}|arg tNEQ arg{$$=call_bin_op($1, tNEQ, $3);}|arg tMATCH arg{$$=match_op($1, $3);if(nd_type($1)==NODE_LIT &&RB_TYPE_P($1->nd_lit, T_REGEXP)){$$=reg_named_capture_assign($1-> nd_lit,$$);}}|arg tNMATCH arg{$$=call_bin_op($1, tNMATCH, $3);}| '!'arg{$$=call_uni_op(cond($2), '!');}| '~'arg{$$=call_uni_op($2, '~');}|arg tLSHFT arg{$$=call_bin_op($1, tLSHFT, $3);}|arg tRSHFT arg{$$=call_bin_op($1, tRSHFT, $3);}|arg tANDOP arg{$$=logop(NODE_AND, $1, $3);}|arg tOROP arg{$$=logop(NODE_OR, $1, $3);}|keyword_defined opt_nl{in_defined=1;}arg{in_defined=0;$$=new_defined($4);}|arg '?'arg opt_nl ':'arg{value_expr($1);$$=NEW_IF(cond($1), $3, $6);fixpos($$, $1);}|primary{$$=$1;};arg_value:arg{value_expr($1);$$=$1;if(!$$)$$=NEW_NIL();};aref_args:none|args trailer{$$=$1;}|args ','assocs trailer{$$=arg_append($1, NEW_HASH($3));}|assocs trailer{$$=NEW_LIST(NEW_HASH($1));};paren_args: '('opt_call_args rparen{$$=$2;};opt_paren_args:none|paren_args;opt_call_args:none|call_args|args ','{$$=$1;}|args ','assocs ','{$$=arg_append($1, NEW_HASH($3));}|assocs ','{$$=NEW_LIST(NEW_HASH($1));};call_args:command{value_expr($1);$$=NEW_LIST($1);}|args opt_block_arg{$$=arg_blk_pass($1, $2);}|assocs opt_block_arg{$$=NEW_LIST(NEW_HASH($1));$$=arg_blk_pass($$, $2);}|args ','assocs opt_block_arg{$$=arg_append($1, NEW_HASH($3));$$=arg_blk_pass($$, $4);}|block_arg;command_args:{$ < val > $=cmdarg_stack;CMDARG_PUSH(1);}call_args{cmdarg_stack=$ < val > 1;$$=$2;};block_arg:tAMPER arg_value{$$=NEW_BLOCK_PASS($2);};opt_block_arg: ','block_arg{$$=$2;}|none{$$=0;};args:arg_value{$$=NEW_LIST($1);}|tSTAR arg_value{$$=NEW_SPLAT($2);}|args ','arg_value{NODE *n1;if((n1=splat_array($1))!=0){$$=list_append(n1, $3);}else{$$=arg_append($1, $3);}}|args ','tSTAR arg_value{NODE *n1;if((nd_type($4)==NODE_ARRAY)&&(n1=splat_array($1))!=0){$$=list_concat(n1, $4);}else{$$=arg_concat($1, $4);}};mrhs_arg:mrhs|arg_value;mrhs:args ','arg_value{NODE *n1;if((n1=splat_array($1))!=0){$$=list_append(n1, $3);}else{$$=arg_append($1, $3);}}|args ','tSTAR arg_value{NODE *n1;if(nd_type($4)==NODE_ARRAY &&(n1=splat_array($1))!=0){$$=list_concat(n1, $4);}else{$$=arg_concat($1, $4);}}|tSTAR arg_value{$$=NEW_SPLAT($2);};primary:literal|strings|xstring|regexp|words|qwords|symbols|qsymbols|var_ref|backref|tFID{$$=NEW_FCALL($1, 0);}|k_begin{$< val > 1=cmdarg_stack;cmdarg_stack=0;$ < num > $=ruby_sourceline;}bodystmt k_end{cmdarg_stack=$< val > 1;if($3==NULL){$$=NEW_NIL();}else{if(nd_type($3)==NODE_RESCUE||nd_type($3)==NODE_ENSURE) nd_set_line($3,$< num > 2);$$=NEW_BEGIN($3);}nd_set_line($$,$ < num >2);}|tLPAREN_ARG{lex_state=EXPR_ENDARG;}rparen{$$=0;}|tLPAREN_ARG{$ < val >1=cmdarg_stack;cmdarg_stack=0;}expr{lex_state=EXPR_ENDARG;}rparen{cmdarg_stack=$ < val >1;$$=$3;}|tLPAREN compstmt ')'{$$=$2;}|primary_value tCOLON2 tCONSTANT{$$=NEW_COLON2($1, $3);}|tCOLON3 tCONSTANT{$$=NEW_COLON3($2);}|tLBRACK aref_args ']'{if($2==0){$$=NEW_ZARRAY();}else{$$=$2;}}|tLBRACE assoc_list '}'{$$=NEW_HASH($2);}|keyword_return{$$=NEW_RETURN(0);}|keyword_yield '('call_args rparen{$$=new_yield($3);}|keyword_yield '('rparen{$$=NEW_YIELD(0);}|keyword_yield{$$=NEW_YIELD(0);}|keyword_defined opt_nl '('{in_defined=1;}expr rparen{in_defined=0;$$=new_defined($5);}|keyword_not '('expr rparen{$$=call_uni_op(cond($3), '!');}|keyword_not '('rparen{$$=call_uni_op(cond(NEW_NIL()), '!');}|fcall brace_block{$2-> nd_iter=$1;$$=$2;}|method_call|method_call brace_block{block_dup_check($1-> nd_args, $2);$2->nd_iter=$1;$$=$2;}|tLAMBDA lambda{$$=$2;}|k_if expr_value then compstmt if_tail k_end{$$=NEW_IF(cond($2), $4, $5);fixpos($$, $2);}|k_unless expr_value then compstmt opt_else k_end{$$=NEW_UNLESS(cond($2), $4, $5);fixpos($$, $2);}|k_while{COND_PUSH(1);}expr_value do{COND_POP();}compstmt k_end{$$=NEW_WHILE(cond($3), $6, 1);fixpos($$, $3);}|k_until{COND_PUSH(1);}expr_value do{COND_POP();}compstmt k_end{$$=NEW_UNTIL(cond($3), $6, 1);fixpos($$, $3);}|k_case expr_value opt_terms case_body k_end{$$=NEW_CASE($2, $4);fixpos($$, $2);}|k_case opt_terms case_body k_end{$$=NEW_CASE(0, $3);}|k_for for_var keyword_in{COND_PUSH(1);}expr_value do{COND_POP();}compstmt k_end{ID id=internal_id();ID *tbl=ALLOC_N(ID, 2);NODE *m=NEW_ARGS_AUX(0, 0);NODE *args,*scope;if(nd_type($2)==NODE_MASGN){NODE *one=NEW_LIST(NEW_LIT(INT2FIX(1)));NODE *zero=NEW_LIST(NEW_LIT(INT2FIX(0)));m-> nd_next=block_append(NEW_IF(NEW_NODE(NODE_AND, NEW_CALL(NEW_CALL(NEW_DVAR(id), idLength, 0), idEq, one), NEW_CALL(NEW_CALL(NEW_DVAR(id), idAREF, zero), rb_intern("kind_of?"), NEW_LIST(NEW_LIT(rb_cArray))), 0), NEW_DASGN_CURR(id, NEW_CALL(NEW_DVAR(id), idAREF, zero)), 0), node_assign($2, NEW_DVAR(id)));args=new_args(m, 0, id, 0, new_args_tail(0, 0, 0));}else{if(nd_type($2)==NODE_LASGN||nd_type($2)==NODE_DASGN||nd_type($2)==NODE_DASGN_CURR){$2-> nd_value=NEW_DVAR(id);m-> nd_plen=1;m->nd_next=$2;args=new_args(m, 0, 0, 0, new_args_tail(0, 0, 0));}else{m->nd_next=node_assign(NEW_MASGN(NEW_LIST($2), 0), NEW_DVAR(id));args=new_args(m, 0, id, 0, new_args_tail(0, 0, 0));}}scope=NEW_NODE(NODE_SCOPE, tbl, $8, args);tbl[0]=1;tbl[1]=id;$$=NEW_FOR(0, $5, scope);fixpos($$, $2);}|k_class cpath superclass{if(in_def||in_single) yyerror("class definition in method body");local_push(0);$ < num > $=ruby_sourceline;}bodystmt k_end{$$=NEW_CLASS($2, $5, $3);nd_set_line($$,$< num > 4);local_pop();}|k_class tLSHFT expr{$< num > $=in_def;in_def=0;}term{$ < num > $=in_single;in_single=0;local_push(0);}bodystmt k_end{$$=NEW_SCLASS($3, $7);fixpos($$, $3);local_pop();in_def=$ < num >4;in_single=$< num > 6;}|k_module cpath{if(in_def||in_single) yyerror("module definition in method body");local_push(0);$ < num > $=ruby_sourceline;}bodystmt k_end{$$=NEW_MODULE($2, $4);nd_set_line($$,$< num > 3);local_pop();}|k_def fname{$ < id > $=cur_mid;cur_mid=$2;in_def++;local_push(0);}f_arglist bodystmt k_end{NODE *body=remove_begin($5);reduce_nodes(&body);$$=NEW_DEFN($2, $4, body, NOEX_PRIVATE);nd_set_line($$,$ < num >1);local_pop();in_def--;cur_mid=$ < id >3;}|k_def singleton dot_or_colon{lex_state=EXPR_FNAME;}fname{in_single++;lex_state=EXPR_ENDFN;local_push(0);}f_arglist bodystmt k_end{NODE *body=remove_begin($8);reduce_nodes(&body);$$=NEW_DEFS($2, $5, $7, body);nd_set_line($$,$ < num >1);local_pop();in_single--;}|keyword_break{$$=NEW_BREAK(0);}|keyword_next{$$=NEW_NEXT(0);}|keyword_redo{$$=NEW_REDO();}|keyword_retry{$$=NEW_RETRY();};primary_value:primary{value_expr($1);$$=$1;if(!$$)$$=NEW_NIL();};k_begin:keyword_begin{token_info_push("begin");};k_if:keyword_if{token_info_push("if");};k_unless:keyword_unless{token_info_push("unless");};k_while:keyword_while{token_info_push("while");};k_until:keyword_until{token_info_push("until");};k_case:keyword_case{token_info_push("case");};k_for:keyword_for{token_info_push("for");};k_class:keyword_class{token_info_push("class");};k_module:keyword_module{token_info_push("module");};k_def:keyword_def{token_info_push("def");$ < num > $=ruby_sourceline;};k_end:keyword_end{token_info_pop("end");};then:term|keyword_then|term keyword_then;do:term|keyword_do_cond;if_tail:opt_else|keyword_elsif expr_value then compstmt if_tail{$$=NEW_IF(cond($2), $4, $5);fixpos($$, $2);};opt_else:none|keyword_else compstmt{$$=$2;};for_var:lhs|mlhs;f_marg:f_norm_arg{$$=assignable($1, 0);}|tLPAREN f_margs rparen{$$=$2;};f_marg_list:f_marg{$$=NEW_LIST($1);}|f_marg_list ','f_marg{$$=list_append($1, $3);};f_margs:f_marg_list{$$=NEW_MASGN($1, 0);}|f_marg_list ','tSTAR f_norm_arg{$$=assignable($4, 0);$$=NEW_MASGN($1,$$);}|f_marg_list ','tSTAR f_norm_arg ','f_marg_list{$$=assignable($4, 0);$$=NEW_MASGN($1, NEW_POSTARG($$, $6));}|f_marg_list ','tSTAR{$$=NEW_MASGN($1,-1);}|f_marg_list ','tSTAR ','f_marg_list{$$=NEW_MASGN($1, NEW_POSTARG(-1, $5));}|tSTAR f_norm_arg{$$=assignable($2, 0);$$=NEW_MASGN(0,$$);}|tSTAR f_norm_arg ','f_marg_list{$$=assignable($2, 0);$$=NEW_MASGN(0, NEW_POSTARG($$, $4));}|tSTAR{$$=NEW_MASGN(0,-1);}|tSTAR ','f_marg_list{$$=NEW_MASGN(0, NEW_POSTARG(-1, $3));};block_args_tail:f_block_kwarg ','f_kwrest opt_f_block_arg{$$=new_args_tail($1, $3, $4);}|f_block_kwarg opt_f_block_arg{$$=new_args_tail($1, Qnone, $2);}|f_kwrest opt_f_block_arg{$$=new_args_tail(Qnone, $1, $2);}|f_block_arg{$$=new_args_tail(Qnone, Qnone, $1);};opt_block_args_tail: ','block_args_tail{$$=$2;}|{$$=new_args_tail(Qnone, Qnone, Qnone);};block_param:f_arg ','f_block_optarg ','f_rest_arg opt_block_args_tail{$$=new_args($1, $3, $5, Qnone, $6);}|f_arg ','f_block_optarg ','f_rest_arg ','f_arg opt_block_args_tail{$$=new_args($1, $3, $5, $7, $8);}|f_arg ','f_block_optarg opt_block_args_tail{$$=new_args($1, $3, Qnone, Qnone, $4);}|f_arg ','f_block_optarg ','f_arg opt_block_args_tail{$$=new_args($1, $3, Qnone, $5, $6);}|f_arg ','f_rest_arg opt_block_args_tail{$$=new_args($1, Qnone, $3, Qnone, $4);}|f_arg ','{$$=new_args($1, Qnone, 1, Qnone, new_args_tail(Qnone, Qnone, Qnone));}|f_arg ','f_rest_arg ','f_arg opt_block_args_tail{$$=new_args($1, Qnone, $3, $5, $6);}|f_arg opt_block_args_tail{$$=new_args($1, Qnone, Qnone, Qnone, $2);}|f_block_optarg ','f_rest_arg opt_block_args_tail{$$=new_args(Qnone, $1, $3, Qnone, $4);}|f_block_optarg ','f_rest_arg ','f_arg opt_block_args_tail{$$=new_args(Qnone, $1, $3, $5, $6);}|f_block_optarg opt_block_args_tail{$$=new_args(Qnone, $1, Qnone, Qnone, $2);}|f_block_optarg ','f_arg opt_block_args_tail{$$=new_args(Qnone, $1, Qnone, $3, $4);}|f_rest_arg opt_block_args_tail{$$=new_args(Qnone, Qnone, $1, Qnone, $2);}|f_rest_arg ','f_arg opt_block_args_tail{$$=new_args(Qnone, Qnone, $1, $3, $4);}|block_args_tail{$$=new_args(Qnone, Qnone, Qnone, Qnone, $1);};opt_block_param:none|block_param_def{command_start=TRUE;};block_param_def: '|'opt_bv_decl '|'{$$=0;}|tOROP{$$=0;}| '|'block_param opt_bv_decl '|'{$$=$2;};opt_bv_decl:opt_nl{$$=0;}|opt_nl ';'bv_decls opt_nl{$$=0;};bv_decls:bvar|bv_decls ','bvar;bvar:tIDENTIFIER{new_bv(get_id($1));}|f_bad_arg{$$=0;};lambda:{$ < vars > $=dyna_push();}{$ < num > $=lpar_beg;lpar_beg=++paren_nest;}f_larglist{$ < num > $=ruby_sourceline;}lambda_body{lpar_beg=$ < num >2;$$=NEW_LAMBDA($3, $5);nd_set_line($$,$< num > 4);dyna_pop($< vars > 1);};f_larglist: '('f_args opt_bv_decl ')'{$$=$2;}|f_args{$$=$1;};lambda_body:tLAMBEG compstmt '}'{$$=$2;}|keyword_do_LAMBDA compstmt keyword_end{$$=$2;};do_block:keyword_do_block{$ < vars >1=dyna_push();$< num > $=ruby_sourceline;}opt_block_param compstmt keyword_end{$$=NEW_ITER($3, $4);nd_set_line($$,$< num > 2);dyna_pop($< vars > 1);};block_call:command do_block{if(nd_type($1)==NODE_YIELD){compile_error(PARSER_ARG"block given to yield");}else{block_dup_check($1-> nd_args, $2);}$2->nd_iter=$1;$$=$2;fixpos($$, $1);}|block_call dot_or_colon operation2 opt_paren_args{$$=NEW_CALL($1, $3, $4);}|block_call dot_or_colon operation2 opt_paren_args brace_block{block_dup_check($4, $5);$5-> nd_iter=NEW_CALL($1, $3, $4);$$=$5;fixpos($$, $1);}|block_call dot_or_colon operation2 command_args do_block{block_dup_check($4, $5);$5-> nd_iter=NEW_CALL($1, $3, $4);$$=$5;fixpos($$, $1);};method_call:fcall paren_args{$$=$1;$$->nd_args=$2;}|primary_value '.'operation2{$< num > $=ruby_sourceline;}opt_paren_args{$$=NEW_CALL($1, $3, $5);nd_set_line($$,$< num > 4);}|primary_value tCOLON2 operation2{$< num > $=ruby_sourceline;}paren_args{$$=NEW_CALL($1, $3, $5);nd_set_line($$,$< num > 4);}|primary_value tCOLON2 operation3{$$=NEW_CALL($1, $3, 0);}|primary_value '.'{$ < num > $=ruby_sourceline;}paren_args{$$=NEW_CALL($1, rb_intern("call"), $4);nd_set_line($$,$< num > 3);}|primary_value tCOLON2{$ < num > $=ruby_sourceline;}paren_args{$$=NEW_CALL($1, rb_intern("call"), $4);nd_set_line($$,$< num > 3);}|keyword_super paren_args{$$=NEW_SUPER($2);}|keyword_super{$$=NEW_ZSUPER();}|primary_value '['opt_call_args rbracket{if($1 &&nd_type($1)==NODE_SELF)$$=NEW_FCALL(tAREF, $3);else $$=NEW_CALL($1, tAREF, $3);fixpos($$, $1);};brace_block: '{'{$< vars > 1=dyna_push();$< num > $=ruby_sourceline;}opt_block_param compstmt '}'{$$=NEW_ITER($3, $4);nd_set_line($$,$< num > 2);dyna_pop($< vars > 1);}|keyword_do{$< vars > 1=dyna_push();$< num > $=ruby_sourceline;}opt_block_param compstmt keyword_end{$$=NEW_ITER($3, $4);nd_set_line($$,$< num > 2);dyna_pop($< vars > 1);};case_body:keyword_when args then compstmt cases{$$=NEW_WHEN($2, $4, $5);};cases:opt_else|case_body;opt_rescue:keyword_rescue exc_list exc_var then compstmt opt_rescue{if($3){$3=node_assign($3, NEW_ERRINFO());$5=block_append($3, $5);}$$=NEW_RESBODY($2, $5, $6);fixpos($$, $2?$2:$5);}|none;exc_list:arg_value{$$=NEW_LIST($1);}|mrhs{if(!($$=splat_array($1)))$$=$1;}|none;exc_var:tASSOC lhs{$$=$2;}|none;opt_ensure:keyword_ensure compstmt{$$=$2;}|none;literal:numeric|symbol{$$=NEW_LIT(ID2SYM($1));}|dsym;strings:string{NODE *node=$1;if(!node){node=NEW_STR(STR_NEW0());}else{node=evstr2dstr(node);}$$=node;};string:tCHAR|string1|string string1{$$=literal_concat($1, $2);};string1:tSTRING_BEG string_contents tSTRING_END{$$=$2;};xstring:tXSTRING_BEG xstring_contents tSTRING_END{NODE *node=$2;if(!node){node=NEW_XSTR(STR_NEW0());}else{switch(nd_type(node)){case NODE_STR:nd_set_type(node, NODE_XSTR);break;case NODE_DSTR:nd_set_type(node, NODE_DXSTR);break;default:node=NEW_NODE(NODE_DXSTR, Qnil, 1, NEW_LIST(node));break;}}$$=node;};regexp:tREGEXP_BEG regexp_contents tREGEXP_END{int options=$3;NODE *node=$2;NODE *list,*prev;if(!node){node=NEW_LIT(reg_compile(STR_NEW0(), options));}else switch(nd_type(node)){case NODE_STR:{VALUE src=node-> nd_lit;nd_set_type(node, NODE_LIT);node->nd_lit=reg_compile(src, options);}break;default:node=NEW_NODE(NODE_DSTR, STR_NEW0(), 1, NEW_LIST(node));case NODE_DSTR:if(options &RE_OPTION_ONCE){nd_set_type(node, NODE_DREGX_ONCE);}else{nd_set_type(node, NODE_DREGX);}node->nd_cflag=options &RE_OPTION_MASK;if(!NIL_P(node-> nd_lit)) reg_fragment_check(node-> nd_lit, options);for(list=(prev=node) -> nd_next;list;list=list-> nd_next){if(nd_type(list-> nd_head)==NODE_STR){VALUE tail=list-> nd_head->nd_lit;if(reg_fragment_check(tail, options)&&prev &&!NIL_P(prev-> nd_lit)){VALUE lit=prev==node?prev-> nd_lit:prev->nd_head->nd_lit;if(!literal_concat0(parser, lit, tail)){node=0;break;}rb_str_resize(tail, 0);prev->nd_next=list->nd_next;rb_gc_force_recycle((VALUE) list->nd_head);rb_gc_force_recycle((VALUE) list);list=prev;}else{prev=list;}}else{prev=0;}}if(!node-> nd_next){VALUE src=node-> nd_lit;nd_set_type(node, NODE_LIT);node->nd_lit=reg_compile(src, options);}break;}$$=node;};words:tWORDS_BEG ' 'tSTRING_END{$$=NEW_ZARRAY();}|tWORDS_BEG word_list tSTRING_END{$$=$2;};word_list:{$$=0;}|word_list word ' '{$$=list_append($1, evstr2dstr($2));};word:string_content|word string_content{$$=literal_concat($1, $2);};symbols:tSYMBOLS_BEG ' 'tSTRING_END{$$=NEW_ZARRAY();}|tSYMBOLS_BEG symbol_list tSTRING_END{$$=$2;};symbol_list:{$$=0;}|symbol_list word ' '{$2=evstr2dstr($2);nd_set_type($2, NODE_DSYM);$$=list_append($1, $2);};qwords:tQWORDS_BEG ' 'tSTRING_END{$$=NEW_ZARRAY();}|tQWORDS_BEG qword_list tSTRING_END{$$=$2;};qsymbols:tQSYMBOLS_BEG ' 'tSTRING_END{$$=NEW_ZARRAY();}|tQSYMBOLS_BEG qsym_list tSTRING_END{$$=$2;};qword_list:{$$=0;}|qword_list tSTRING_CONTENT ' '{$$=list_append($1, $2);};qsym_list:{$$=0;}|qsym_list tSTRING_CONTENT ' '{VALUE lit;lit=$2-> nd_lit;$2->nd_lit=ID2SYM(rb_intern_str(lit));nd_set_type($2, NODE_LIT);$$=list_append($1, $2);};string_contents:{$$=0;}|string_contents string_content{$$=literal_concat($1, $2);};xstring_contents:{$$=0;}|xstring_contents string_content{$$=literal_concat($1, $2);};regexp_contents:{$$=0;}|regexp_contents string_content{NODE *head=$1,*tail=$2;if(!head){$$=tail;}else if(!tail){$$=head;}else{switch(nd_type(head)){case NODE_STR:nd_set_type(head, NODE_DSTR);break;case NODE_DSTR:break;default:head=list_append(NEW_DSTR(Qnil), head);break;}$$=list_append(head, tail);}};string_content:tSTRING_CONTENT|tSTRING_DVAR{$ < node > $=lex_strterm;lex_strterm=0;lex_state=EXPR_BEG;}string_dvar{lex_strterm=$ < node >2;$$=NEW_EVSTR($3);}|tSTRING_DBEG{$ < val >1=cond_stack;$< val > $=cmdarg_stack;cond_stack=0;cmdarg_stack=0;}{$ < node > $=lex_strterm;lex_strterm=0;lex_state=EXPR_BEG;}{$ < num > $=brace_nest;brace_nest=0;}compstmt tSTRING_DEND{cond_stack=$< val > 1;cmdarg_stack=$< val > 2;lex_strterm=$< node > 3;brace_nest=$< num >4;if($5) $5-> flags &=~NODE_FL_NEWLINE;$$=new_evstr($5);};string_dvar:tGVAR{$$=NEW_GVAR($1);}|tIVAR{$$=NEW_IVAR($1);}|tCVAR{$$=NEW_CVAR($1);}|backref;symbol:tSYMBEG sym{lex_state=EXPR_END;$$=$2;};sym:fname|tIVAR|tGVAR|tCVAR;dsym:tSYMBEG xstring_contents tSTRING_END{lex_state=EXPR_END;$$=dsym_node($2);};numeric:simple_numeric|tUMINUS_NUM simple_numeric%prec tLOWEST{$$=negate_lit($2);};simple_numeric:tINTEGER|tFLOAT|tRATIONAL|tIMAGINARY;user_variable:tIDENTIFIER|tIVAR|tGVAR|tCONSTANT|tCVAR;keyword_variable:keyword_nil{ifndef_ripper($$=keyword_nil);}|keyword_self{ifndef_ripper($$=keyword_self);}|keyword_true{ifndef_ripper($$=keyword_true);}|keyword_false{ifndef_ripper($$=keyword_false);}|keyword__FILE__{ifndef_ripper($$=keyword__FILE__);}|keyword__LINE__{ifndef_ripper($$=keyword__LINE__);}|keyword__ENCODING__{ifndef_ripper($$=keyword__ENCODING__);};var_ref:user_variable{if(!($$=gettable($1)))$$=NEW_BEGIN(0);}|keyword_variable{if(!($$=gettable($1)))$$=NEW_BEGIN(0);};var_lhs:user_variable{$$=assignable($1, 0);}|keyword_variable{$$=assignable($1, 0);};backref:tNTH_REF|tBACK_REF;superclass:term{$$=0;}| ' <'{lex_state=EXPR_BEG;command_start=TRUE;}expr_value term{$$=$3;}|error term{yyerrok;$$=0;};f_arglist: '('f_args rparen{$$=$2;lex_state=EXPR_BEG;command_start=TRUE;}|{$ < num > $=parser-> parser_in_kwarg;parser-> parser_in_kwarg=1;}f_args term{parser-> parser_in_kwarg=$< num > 1;$$=$2;lex_state=EXPR_BEG;command_start=TRUE;};args_tail:f_kwarg ','f_kwrest opt_f_block_arg{$$=new_args_tail($1, $3, $4);}|f_kwarg opt_f_block_arg{$$=new_args_tail($1, Qnone, $2);}|f_kwrest opt_f_block_arg{$$=new_args_tail(Qnone, $1, $2);}|f_block_arg{$$=new_args_tail(Qnone, Qnone, $1);};opt_args_tail: ','args_tail{$$=$2;}|{$$=new_args_tail(Qnone, Qnone, Qnone);};f_args:f_arg ','f_optarg ','f_rest_arg opt_args_tail{$$=new_args($1, $3, $5, Qnone, $6);}|f_arg ','f_optarg ','f_rest_arg ','f_arg opt_args_tail{$$=new_args($1, $3, $5, $7, $8);}|f_arg ','f_optarg opt_args_tail{$$=new_args($1, $3, Qnone, Qnone, $4);}|f_arg ','f_optarg ','f_arg opt_args_tail{$$=new_args($1, $3, Qnone, $5, $6);}|f_arg ','f_rest_arg opt_args_tail{$$=new_args($1, Qnone, $3, Qnone, $4);}|f_arg ','f_rest_arg ','f_arg opt_args_tail{$$=new_args($1, Qnone, $3, $5, $6);}|f_arg opt_args_tail{$$=new_args($1, Qnone, Qnone, Qnone, $2);}|f_optarg ','f_rest_arg opt_args_tail{$$=new_args(Qnone, $1, $3, Qnone, $4);}|f_optarg ','f_rest_arg ','f_arg opt_args_tail{$$=new_args(Qnone, $1, $3, $5, $6);}|f_optarg opt_args_tail{$$=new_args(Qnone, $1, Qnone, Qnone, $2);}|f_optarg ','f_arg opt_args_tail{$$=new_args(Qnone, $1, Qnone, $3, $4);}|f_rest_arg opt_args_tail{$$=new_args(Qnone, Qnone, $1, Qnone, $2);}|f_rest_arg ','f_arg opt_args_tail{$$=new_args(Qnone, Qnone, $1, $3, $4);}|args_tail{$$=new_args(Qnone, Qnone, Qnone, Qnone, $1);}|{$$=new_args_tail(Qnone, Qnone, Qnone);$$=new_args(Qnone, Qnone, Qnone, Qnone,$$);};f_bad_arg:tCONSTANT{yyerror("formal argument cannot be a constant");$$=0;}|tIVAR{yyerror("formal argument cannot be an instance variable");$$=0;}|tGVAR{yyerror("formal argument cannot be a global variable");$$=0;}|tCVAR{yyerror("formal argument cannot be a class variable");$$=0;};f_norm_arg:f_bad_arg|tIDENTIFIER{formal_argument(get_id($1));$$=$1;};f_arg_item:f_norm_arg{arg_var(get_id($1));$$=NEW_ARGS_AUX($1, 1);}|tLPAREN f_margs rparen{ID tid=internal_id();arg_var(tid);if(dyna_in_block()){$2-> nd_value=NEW_DVAR(tid);}else{$2-> nd_value=NEW_LVAR(tid);}$$=NEW_ARGS_AUX(tid, 1);$$-> nd_next=$2;};f_arg:f_arg_item|f_arg ','f_arg_item{$$=$1;$$-> nd_plen++;$$->nd_next=block_append($$-> nd_next, $3->nd_next);rb_gc_force_recycle((VALUE)$3);};f_label:tLABEL{arg_var(formal_argument(get_id($1)));$$=$1;};f_kw:f_label arg_value{$$=assignable($1, $2);$$=NEW_KW_ARG(0,$$);}|f_label{$$=assignable($1,(NODE *)-1);$$=NEW_KW_ARG(0,$$);};f_block_kw:f_label primary_value{$$=assignable($1, $2);$$=NEW_KW_ARG(0,$$);}|f_label{$$=assignable($1,(NODE *)-1);$$=NEW_KW_ARG(0,$$);};f_block_kwarg:f_block_kw{$$=$1;}|f_block_kwarg ','f_block_kw{NODE *kws=$1;while(kws-> nd_next){kws=kws->nd_next;}kws-> nd_next=$3;$$=$1;};f_kwarg:f_kw{$$=$1;}|f_kwarg ','f_kw{NODE *kws=$1;while(kws-> nd_next){kws=kws->nd_next;}kws-> nd_next=$3;$$=$1;};kwrest_mark:tPOW|tDSTAR;f_kwrest:kwrest_mark tIDENTIFIER{shadowing_lvar(get_id($2));$$=$2;}|kwrest_mark{$$=internal_id();};f_opt:f_norm_arg '='arg_value{arg_var(get_id($1));$$=assignable($1, $3);$$=NEW_OPT_ARG(0,$$);};f_block_opt:f_norm_arg '='primary_value{arg_var(get_id($1));$$=assignable($1, $3);$$=NEW_OPT_ARG(0,$$);};f_block_optarg:f_block_opt{$$=$1;}|f_block_optarg ','f_block_opt{NODE *opts=$1;while(opts-> nd_next){opts=opts->nd_next;}opts-> nd_next=$3;$$=$1;};f_optarg:f_opt{$$=$1;}|f_optarg ','f_opt{NODE *opts=$1;while(opts-> nd_next){opts=opts->nd_next;}opts-> nd_next=$3;$$=$1;};restarg_mark: '*'|tSTAR;f_rest_arg:restarg_mark tIDENTIFIER{if(!is_local_id($2)) yyerror("rest argument must be local variable");arg_var(shadowing_lvar(get_id($2)));$$=$2;}|restarg_mark{$$=internal_id();arg_var($$);};blkarg_mark: '&'|tAMPER;f_block_arg:blkarg_mark tIDENTIFIER{if(!is_local_id($2)) yyerror("block argument must be local variable");else if(!dyna_in_block()&&local_id($2)) yyerror("duplicated block argument name");arg_var(shadowing_lvar(get_id($2)));$$=$2;};opt_f_block_arg: ','f_block_arg{$$=$2;}|none{$$=0;};singleton:var_ref{value_expr($1);$$=$1;if(!$$)$$=NEW_NIL();}| '('{lex_state=EXPR_BEG;}expr rparen{if($3==0){yyerror("can't define singleton method for ().");}else{switch(nd_type($3)){case NODE_STR:case NODE_DSTR:case NODE_XSTR:case NODE_DXSTR:case NODE_DREGX:case NODE_LIT:case NODE_ARRAY:case NODE_ZARRAY:yyerror("can't define singleton method for literals");default:value_expr($3);break;}}$$=$3;};assoc_list:none|assocs trailer{$$=$1;};assocs:assoc|assocs ','assoc{$$=list_concat($1, $3);};assoc:arg_value tASSOC arg_value{if(nd_type($1)==NODE_STR){nd_set_type($1, NODE_LIT);$1->nd_lit=rb_fstring($1-> nd_lit);}$$=list_append(NEW_LIST($1), $3);}|tLABEL arg_value{$$=list_append(NEW_LIST(NEW_LIT(ID2SYM($1))), $2);}|tDSTAR arg_value{$$=list_append(NEW_LIST(0), $2);};;operation:tIDENTIFIER|tCONSTANT|tFID;operation2:tIDENTIFIER|tCONSTANT|tFID|op;operation3:tIDENTIFIER|tFID|op;dot_or_colon: '.'|tCOLON2;opt_terms:|terms;opt_nl:| '\n';rparen:opt_nl ')';rbracket:opt_nl ']';trailer:| '\n'| ',';term: ';'{yyerrok;}| '\n';terms:term|terms ';'{yyerrok;};none:{$$=0;};%%#define yylvalstatic int parser_regx_options(struct parser_params *);static int parser_tokadd_string(struct parser_params *, int, int, int, long *, rb_encoding **);static void parser_tokaddmbc(struct parser_params *parser, int c, rb_encoding *enc);static int parser_parse_string(struct parser_params *, NODE *);static int parser_here_document(struct parser_params *, NODE *);#define nextc()#define pushback(c)#define newtok()#define tokspace(n)#define tokadd(c)#define tok_hex(numlen)#define read_escape(flags, e)#define tokadd_escape(e)#define regx_options()#define tokadd_string(f, t, p, n, e)#define parse_string(n)#define tokaddmbc(c, enc)#define here_document(n)#define heredoc_identifier()#define heredoc_restore(n)#define whole_match_p(e, l, i)#define number_literal_suffix(f)#define set_number_literal(v, t, f)#define set_integer_literal(v, f)#define set_yylval_str(x)#define set_yylval_num(x)#define set_yylval_id(x)#define set_yylval_name(x)#define set_yylval_literal(x)#define set_yylval_node(x)#define yylval_id()#define ripper_flush(p)#define SIGN_EXTEND_CHAR(c)#define parser_encoding_name()#define parser_mbclen()#define parser_precise_mbclen()#define is_identchar(p, e, enc)#define parser_is_identchar()#define parser_isascii() static inttoken_info_get_column(struct parser_params *parser, const char *token){int column=1;const char *p,*pend=lex_p-strlen(token);for(p=lex_pbeg;p < pend;p++){if(*p== '\t'){column=(((column-1)/8)+1)*8;}column++;}return column;}static inttoken_info_has_nonspaces(struct parser_params *parser, const char *token){const char *p,*pend=lex_p-strlen(token);for(p=lex_pbeg;p < pend;p++){if(*p!= ' '&&*p!= '\t'){return 1;}}return 0;}static voidtoken_info_push(struct parser_params *parser, const char *token){token_info *ptinfo;if(!parser-> parser_token_info_enabled) return;ptinfo=ALLOC(token_info);ptinfo-> token=token;ptinfo->linenum=ruby_sourceline;ptinfo-> column=token_info_get_column(parser, token);ptinfo->nonspc=token_info_has_nonspaces(parser, token);ptinfo->next=parser-> parser_token_info;parser-> parser_token_info=ptinfo;}static voidtoken_info_pop(struct parser_params *parser, const char *token){int linenum;token_info *ptinfo=parser-> parser_token_info;if(!ptinfo) return;parser-> parser_token_info=ptinfo->next;if(token_info_get_column(parser, token)==ptinfo->column){goto finish;}linenum=ruby_sourceline;if(linenum==ptinfo-> linenum){goto finish;}if(token_info_has_nonspaces(parser, token)||ptinfo->nonspc){goto finish;}if(parser-> parser_token_info_enabled){rb_compile_warn(ruby_sourcefile, linenum,"mismatched indentations at '%s' with '%s' at %d", token, ptinfo->token, ptinfo->linenum);}finish:xfree(ptinfo);}static intparser_yyerror(struct parser_params *parser, const char *msg){const int max_line_margin=30;const char *p,*pe;char *buf;long len;int i;compile_error(PARSER_ARG"%s", msg);p=lex_p;while(lex_pbeg<=p){if(*p== '\n') break;p--;}p++;pe=lex_p;while(pe < lex_pend){if(*pe== '\n') break;pe++;}len=pe-p;if(len > 4){char *p2;const char *pre="",*post="";if(len > max_line_margin *2+10){if(lex_p-p > max_line_margin){p=rb_enc_prev_char(p, lex_p-max_line_margin, pe, rb_enc_get(lex_lastline));pre="...";}if(pe-lex_p > max_line_margin){pe=rb_enc_prev_char(lex_p, lex_p+max_line_margin, pe, rb_enc_get(lex_lastline));post="...";}len=pe-p;}buf=ALLOCA_N(char, len+2);MEMCPY(buf, p, char, len);buf[len]= '\0';rb_compile_error_with_enc(NULL, 0,(void *) current_enc,"%s%s%s", pre, buf, post);i=(int)(lex_p-p);p2=buf;pe=buf+len;while(p2 < pe){if(*p2!= '\t')*p2= ' ';p2++;}buf[i]= '^';buf[i+1]= '\0';rb_compile_error_append("%s%s", pre, buf);}return 0;}static void parser_prepare(struct parser_params *parser);static VALUEdebug_lines(VALUE fname){ID script_lines;CONST_ID(script_lines,"SCRIPT_LINES__");if(rb_const_defined_at(rb_cObject, script_lines)){VALUE hash=rb_const_get_at(rb_cObject, script_lines);if(RB_TYPE_P(hash, T_HASH)){VALUE lines=rb_ary_new();rb_hash_aset(hash, fname, lines);return lines;}}return 0;}static VALUEcoverage(VALUE fname, int n){VALUE coverages=rb_get_coverages();if(RTEST(coverages)&&RBASIC(coverages) -> klass==0){VALUE lines=rb_ary_new2(n);int i;RBASIC_CLEAR_CLASS(lines);for(i=0;i < n;i++) RARRAY_ASET(lines, i, Qnil);RARRAY(lines) -> as.heap.len=n;rb_hash_aset(coverages, fname, lines);return lines;}return 0;}static inte_option_supplied(struct parser_params *parser){return strcmp(ruby_sourcefile,"-e")==0;}static VALUEyycompile0(VALUE arg){int n;NODE *tree;struct parser_params *parser=(struct parser_params *) arg;if(!compile_for_eval &&rb_safe_level()==0){ruby_debug_lines=debug_lines(ruby_sourcefile_string);if(ruby_debug_lines &&ruby_sourceline > 0){VALUE str=STR_NEW0();n=ruby_sourceline;do{rb_ary_push(ruby_debug_lines, str);}while(--n);}if(!e_option_supplied(parser)){ruby_coverage=coverage(ruby_sourcefile_string, ruby_sourceline);}}parser-> last_cr_line=ruby_sourceline-1;parser_prepare(parser);deferred_nodes=0;parser-> parser_token_info_enabled=!compile_for_eval &&RTEST(ruby_verbose);if(RUBY_DTRACE_PARSE_BEGIN_ENABLED()){RUBY_DTRACE_PARSE_BEGIN(parser-> parser_ruby_sourcefile, parser-> parser_ruby_sourceline);}n=yyparse((void *) parser);if(RUBY_DTRACE_PARSE_END_ENABLED()){RUBY_DTRACE_PARSE_END(parser-> parser_ruby_sourcefile, parser-> parser_ruby_sourceline);}ruby_debug_lines=0;ruby_coverage=0;compile_for_eval=0;lex_strterm=0;lex_p=lex_pbeg=lex_pend=0;lex_lastline=lex_nextline=0;if(parser-> nerr){return 0;}tree=ruby_eval_tree;if(!tree){tree=NEW_NIL();}else if(ruby_eval_tree_begin){tree-> nd_body=NEW_PRELUDE(ruby_eval_tree_begin, tree->nd_body);}return(VALUE) tree;}static NODE *yycompile(struct parser_params *parser, VALUE fname, int line){ruby_sourcefile_string=rb_str_new_frozen(fname);ruby_sourcefile=RSTRING_PTR(fname);ruby_sourceline=line-1;return(NODE *) rb_suppress_tracing(yycompile0,(VALUE) parser);}static rb_encoding *must_be_ascii_compatible(VALUE s){rb_encoding *enc=rb_enc_get(s);if(!rb_enc_asciicompat(enc)){rb_raise(rb_eArgError,"invalid source encoding");}return enc;}static VALUElex_get_str(struct parser_params *parser, VALUE s){char *beg,*end,*pend;rb_encoding *enc=must_be_ascii_compatible(s);beg=RSTRING_PTR(s);if(lex_gets_ptr){if(RSTRING_LEN(s)==lex_gets_ptr) return Qnil;beg+=lex_gets_ptr;}pend=RSTRING_PTR(s)+RSTRING_LEN(s);end=beg;while(end < pend){if(*end++== '\n') break;}lex_gets_ptr=end-RSTRING_PTR(s);return rb_enc_str_new(beg, end-beg, enc);}static VALUElex_getline(struct parser_params *parser){VALUE line=(*parser->parser_lex_gets)(parser, parser->parser_lex_input);if(NIL_P(line)) return line;must_be_ascii_compatible(line);if(ruby_debug_lines){rb_enc_associate(line, current_enc);rb_ary_push(ruby_debug_lines, line);}if(ruby_coverage){rb_ary_push(ruby_coverage, Qnil);}return line;}static const rb_data_type_t parser_data_type;static NODE *parser_compile_string(volatile VALUE vparser, VALUE fname, VALUE s, int line){struct parser_params *parser;NODE *node;TypedData_Get_Struct(vparser, struct parser_params,&parser_data_type, parser);lex_gets=lex_get_str;lex_gets_ptr=0;lex_input=s;lex_pbeg=lex_p=lex_pend=0;compile_for_eval=rb_parse_in_eval();node=yycompile(parser, fname, line);RB_GC_GUARD(vparser);return node;}NODE *rb_compile_string(const char *f, VALUE s, int line){must_be_ascii_compatible(s);return parser_compile_string(rb_parser_new(), rb_filesystem_str_new_cstr(f), s, line);}NODE *rb_parser_compile_string(volatile VALUE vparser, const char *f, VALUE s, int line){return rb_parser_compile_string_path(vparser, rb_filesystem_str_new_cstr(f), s, line);}NODE *rb_parser_compile_string_path(volatile VALUE vparser, VALUE f, VALUE s, int line){must_be_ascii_compatible(s);return parser_compile_string(vparser, f, s, line);}NODE *rb_compile_cstr(const char *f, const char *s, int len, int line){VALUE str=rb_str_new(s, len);return parser_compile_string(rb_parser_new(), rb_filesystem_str_new_cstr(f), str, line);}NODE *rb_parser_compile_cstr(volatile VALUE vparser, const char *f, const char *s, int len, int line){VALUE str=rb_str_new(s, len);return parser_compile_string(vparser, rb_filesystem_str_new_cstr(f), str, line);}static VALUElex_io_gets(struct parser_params *parser, VALUE io){return rb_io_gets(io);}NODE *rb_compile_file(const char *f, VALUE file, int start){VALUE volatile vparser=rb_parser_new();return rb_parser_compile_file(vparser, f, file, start);}NODE *rb_parser_compile_file(volatile VALUE vparser, const char *f, VALUE file, int start){return rb_parser_compile_file_path(vparser, rb_filesystem_str_new_cstr(f), file, start);}NODE *rb_parser_compile_file_path(volatile VALUE vparser, VALUE fname, VALUE file, int start){struct parser_params *parser;NODE *node;TypedData_Get_Struct(vparser, struct parser_params,&parser_data_type, parser);lex_gets=lex_io_gets;lex_input=file;lex_pbeg=lex_p=lex_pend=0;compile_for_eval=rb_parse_in_eval();node=yycompile(parser, fname, start);RB_GC_GUARD(vparser);return node;}#define STR_FUNC_ESCAPE#define STR_FUNC_EXPAND#define STR_FUNC_REGEXP#define STR_FUNC_QWORDS#define STR_FUNC_SYMBOL#define STR_FUNC_INDENTenum string_type{str_squote=(0), str_dquote=(STR_FUNC_EXPAND), str_xquote=(STR_FUNC_EXPAND), str_regexp=(STR_FUNC_REGEXP|STR_FUNC_ESCAPE|STR_FUNC_EXPAND), str_sword=(STR_FUNC_QWORDS), str_dword=(STR_FUNC_QWORDS|STR_FUNC_EXPAND), str_ssym=(STR_FUNC_SYMBOL), str_dsym=(STR_FUNC_SYMBOL|STR_FUNC_EXPAND)};static VALUEparser_str_new(const char *p, long n, rb_encoding *enc, int func, rb_encoding *enc0){VALUE str;str=rb_enc_str_new(p, n, enc);if(!(func &STR_FUNC_REGEXP)&&rb_enc_asciicompat(enc)){if(rb_enc_str_coderange(str)==ENC_CODERANGE_7BIT){}else if(enc0==rb_usascii_encoding()&&enc!=rb_utf8_encoding()){rb_enc_associate(str, rb_ascii8bit_encoding());}}return str;}#define lex_goto_eol(parser)#define lex_eol_p()#define peek(c)#define peek_n(c, n) static inline intparser_nextc(struct parser_params *parser){int c;if(lex_p==lex_pend){VALUE v=lex_nextline;lex_nextline=0;if(!v){if(parser-> eofp) return-1;if(!lex_input||NIL_P(v=lex_getline(parser))){parser-> eofp=Qtrue;lex_goto_eol(parser);return-1;}}{if(heredoc_end > 0){ruby_sourceline=heredoc_end;heredoc_end=0;}ruby_sourceline++;parser-> line_count++;lex_pbeg=lex_p=RSTRING_PTR(v);lex_pend=lex_p+RSTRING_LEN(v);ripper_flush(parser);lex_lastline=v;}}c=(unsigned char)*lex_p++;if(c== '\r'){if(peek('\n')){lex_p++;c= '\n';}else if(ruby_sourceline > parser->last_cr_line){parser-> last_cr_line=ruby_sourceline;rb_compile_warn(ruby_sourcefile, ruby_sourceline,"encountered \\r in middle of line, treated as a mere space");}}return c;}static voidparser_pushback(struct parser_params *parser, int c){if(c==-1) return;lex_p--;if(lex_p > lex_pbeg &&lex_p[0]== '\n'&&lex_p[-1]== '\r'){lex_p--;}}#define was_bol()#define tokfix()#define tok()#define toklen()#define toklast() static char *parser_newtok(struct parser_params *parser){tokidx=0;tokline=ruby_sourceline;if(!tokenbuf){toksiz=60;tokenbuf=ALLOC_N(char, 60);}if(toksiz > 4096){toksiz=60;REALLOC_N(tokenbuf, char, 60);}return tokenbuf;}static char *parser_tokspace(struct parser_params *parser, int n){tokidx+=n;if(tokidx > =toksiz){do{toksiz *=2;}while(toksiz < tokidx);REALLOC_N(tokenbuf, char, toksiz);}return &tokenbuf[tokidx-n];}static voidparser_tokadd(struct parser_params *parser, int c){tokenbuf[tokidx++]=(char) c;if(tokidx >=toksiz){toksiz *=2;REALLOC_N(tokenbuf, char, toksiz);}}static intparser_tok_hex(struct parser_params *parser, size_t *numlen){int c;c=scan_hex(lex_p, 2, numlen);if(!*numlen){yyerror("invalid hex escape");return 0;}lex_p+=*numlen;return c;}#define tokcopy(n) static intparser_tokadd_utf8(struct parser_params *parser, rb_encoding **encp, int string_literal, int symbol_literal, int regexp_literal){int codepoint;size_t numlen;if(regexp_literal){tokadd('\\');tokadd('u');}if(peek('{')){do{if(regexp_literal){tokadd(*lex_p);}nextc();codepoint=scan_hex(lex_p, 6,&numlen);if(numlen==0){yyerror("invalid Unicode escape");return 0;}if(codepoint > 0x10ffff){yyerror("invalid Unicode codepoint (too large)");return 0;}lex_p+=numlen;if(regexp_literal){tokcopy((int) numlen);}else if(codepoint >=0x80){*encp=rb_utf8_encoding();if(string_literal) tokaddmbc(codepoint,*encp);}else if(string_literal){tokadd(codepoint);}}while(string_literal &&(peek(' ')||peek('\t')));if(!peek('}')){yyerror("unterminated Unicode escape");return 0;}if(regexp_literal){tokadd('}');}nextc();}else{codepoint=scan_hex(lex_p, 4,&numlen);if(numlen< 4){yyerror("invalid Unicode escape");return 0;}lex_p+=4;if(regexp_literal){tokcopy(4);}else if(codepoint >=0x80){*encp=rb_utf8_encoding();if(string_literal) tokaddmbc(codepoint,*encp);}else if(string_literal){tokadd(codepoint);}}return codepoint;}#define ESCAPE_CONTROL#define ESCAPE_METAstatic intparser_read_escape(struct parser_params *parser, int flags, rb_encoding **encp){int c;size_t numlen;switch(c=nextc()){case '\\':return c;case 'n':return '\n';case 't':return '\t';case 'r':return '\r';case 'f':return '\f';case 'v':return '\13';case 'a':return '\007';case 'e':return 033;case '0':case '1':case '2':case '3':case '4':case '5':case '6':case '7':pushback(c);c=scan_oct(lex_p, 3,&numlen);lex_p+=numlen;return c;case 'x':c=tok_hex(&numlen);if(numlen==0) return 0;return c;case 'b':return '\010';case 's':return ' ';case 'M':if(flags &ESCAPE_META) goto eof;if((c=nextc())!= '-'){pushback(c);goto eof;}if((c=nextc())== '\\'){if(peek('u')) goto eof;return read_escape(flags|ESCAPE_META, encp)|0x80;}else if(c==-1||!ISASCII(c)) goto eof;else{return((c &0xff)|0x80);}case 'C':if((c=nextc())!= '-'){pushback(c);goto eof;}case 'c':if(flags &ESCAPE_CONTROL) goto eof;if((c=nextc())== '\\'){if(peek('u')) goto eof;c=read_escape(flags|ESCAPE_CONTROL, encp);}else if(c== '?') return 0177;else if(c==-1||!ISASCII(c)) goto eof;return c &0x9f;eof:case-1:yyerror("Invalid escape character syntax");return '\0';default:return c;}}static voidparser_tokaddmbc(struct parser_params *parser, int c, rb_encoding *enc){int len=rb_enc_codelen(c, enc);rb_enc_mbcput(c, tokspace(len), enc);}static intparser_tokadd_escape(struct parser_params *parser, rb_encoding **encp){int c;int flags=0;size_t numlen;first:switch(c=nextc()){case '\n':return 0;case '0':case '1':case '2':case '3':case '4':case '5':case '6':case '7':{ruby_scan_oct(--lex_p, 3,&numlen);if(numlen==0) goto eof;lex_p+=numlen;tokcopy((int) numlen+1);}return 0;case 'x':{tok_hex(&numlen);if(numlen==0) return-1;tokcopy((int) numlen+2);}return 0;case 'M':if(flags &ESCAPE_META) goto eof;if((c=nextc())!= '-'){pushback(c);goto eof;}tokcopy(3);flags|=ESCAPE_META;goto escaped;case 'C':if(flags &ESCAPE_CONTROL) goto eof;if((c=nextc())!= '-'){pushback(c);goto eof;}tokcopy(3);goto escaped;case 'c':if(flags &ESCAPE_CONTROL) goto eof;tokcopy(2);flags|=ESCAPE_CONTROL;escaped:if((c=nextc())== '\\'){goto first;}else if(c==-1) goto eof;tokadd(c);return 0;eof:case-1:yyerror("Invalid escape character syntax");return-1;default:tokadd('\\');tokadd(c);}return 0;}static intparser_regx_options(struct parser_params *parser){int kcode=0;int kopt=0;int options=0;int c, opt, kc;newtok();while(c=nextc(), ISALPHA(c)){if(c== 'o'){options|=RE_OPTION_ONCE;}else if(rb_char_to_option_kcode(c,&opt,&kc)){if(kc >=0){if(kc!=rb_ascii8bit_encindex()) kcode=c;kopt=opt;}else{options|=opt;}}else{tokadd(c);}}options|=kopt;pushback(c);if(toklen()){tokfix();compile_error(PARSER_ARG"unknown regexp option%s - %s", toklen() > 1?"s":"", tok());}return options|RE_OPTION_ENCODING(kcode);}static voiddispose_string(VALUE str){rb_str_free(str);rb_gc_force_recycle(str);}static intparser_tokadd_mbchar(struct parser_params *parser, int c){int len=parser_precise_mbclen();if(!MBCLEN_CHARFOUND_P(len)){compile_error(PARSER_ARG"invalid multibyte char (%s)", parser_encoding_name());return-1;}tokadd(c);lex_p+=--len;if(len > 0) tokcopy(len);return c;}#define tokadd_mbchar(c) static inline intsimple_re_meta(int c){switch(c){case '$':case '*':case '+':case '.':case '?':case '^':case '|':case ')':case ']':case '}':case '>':return TRUE;default:return FALSE;}}static intparser_tokadd_string(struct parser_params *parser, int func, int term, int paren, long *nest, rb_encoding **encp){int c;int has_nonascii=0;rb_encoding *enc=*encp;char *errbuf=0;static const char mixed_msg[]="%s mixed within %s source";#define mixed_error(enc1, enc2)#define mixed_escape(beg, enc1, enc2) while((c=nextc())!=-1){if(paren &&c==paren){++*nest;}else if(c==term){if(!nest||!*nest){pushback(c);break;}--*nest;}else if((func &STR_FUNC_EXPAND)&&c== '#'&&lex_p< lex_pend){int c2=*lex_p;if(c2== '$'||c2== '@'||c2== '{'){pushback(c);break;}}else if(c== '\\'){const char *beg=lex_p-1;c=nextc();switch(c){case '\n':if(func &STR_FUNC_QWORDS) break;if(func &STR_FUNC_EXPAND) continue;tokadd('\\');break;case '\\':if(func &STR_FUNC_ESCAPE) tokadd(c);break;case 'u':if((func &STR_FUNC_EXPAND)==0){tokadd('\\');break;}parser_tokadd_utf8(parser,&enc, 1, func &STR_FUNC_SYMBOL, func &STR_FUNC_REGEXP);if(has_nonascii &&enc!=*encp){mixed_escape(beg, enc,*encp);}continue;default:if(c==-1) return-1;if(!ISASCII(c)){if((func &STR_FUNC_EXPAND)==0) tokadd('\\');goto non_ascii;}if(func &STR_FUNC_REGEXP){if(c==term &&!simple_re_meta(c)){tokadd(c);continue;}pushback(c);if((c=tokadd_escape(&enc))< 0) return-1;if(has_nonascii &&enc!=*encp){mixed_escape(beg, enc,*encp);}continue;}else if(func &STR_FUNC_EXPAND){pushback(c);if(func &STR_FUNC_ESCAPE) tokadd('\\');c=read_escape(0,&enc);}else if((func &STR_FUNC_QWORDS)&&ISSPACE(c)){}else if(c!=term &&!(paren &&c==paren)){tokadd('\\');pushback(c);continue;}}}else if(!parser_isascii()){non_ascii:has_nonascii=1;if(enc!=*encp){mixed_error(enc,*encp);continue;}if(tokadd_mbchar(c)==-1) return-1;continue;}else if((func &STR_FUNC_QWORDS)&&ISSPACE(c)){pushback(c);break;}if(c &0x80){has_nonascii=1;if(enc!=*encp){mixed_error(enc,*encp);continue;}}tokadd(c);}*encp=enc;return c;}#define NEW_STRTERM(func, term, paren)#define flush_string_content(enc) RUBY_FUNC_EXPORTED const unsigned int ruby_global_name_punct_bits[(0x7e-0x20+31)/32];#define BIT(c, idx)#define SPECIAL_PUNCT(idx) const unsigned int ruby_global_name_punct_bits[]={SPECIAL_PUNCT(0), SPECIAL_PUNCT(1), SPECIAL_PUNCT(2),};static inline intis_global_name_punct(const int c){if(c<=0x20||0x7e< c) return 0;return(ruby_global_name_punct_bits[(c-0x20)/32] >>(c%32))&1;}static intparser_peek_variable_name(struct parser_params *parser){int c;const char *p=lex_p;if(p+1 >=lex_pend) return 0;c=*p++;switch(c){case '$':if((c=*p)== '-'){if(++p >=lex_pend) return 0;c=*p;}else if(is_global_name_punct(c)||ISDIGIT(c)){return tSTRING_DVAR;}break;case '@':if((c=*p)== '@'){if(++p >=lex_pend) return 0;c=*p;}break;case '{':lex_p=p;command_start=TRUE;return tSTRING_DBEG;default:return 0;}if(!ISASCII(c)||c== '_'||ISALPHA(c)) return tSTRING_DVAR;return 0;}static intparser_parse_string(struct parser_params *parser, NODE *quote){int func=(int) quote->nd_func;int term=nd_term(quote);int paren=nd_paren(quote);int c, space=0;rb_encoding *enc=current_enc;if(func==-1) return tSTRING_END;c=nextc();if((func &STR_FUNC_QWORDS)&&ISSPACE(c)){do{c=nextc();}while(ISSPACE(c));space=1;}if(c==term &&!quote->nd_nest){if(func &STR_FUNC_QWORDS){quote->nd_func=-1;return ' ';}if(!(func &STR_FUNC_REGEXP)) return tSTRING_END;set_yylval_num(regx_options());return tREGEXP_END;}if(space){pushback(c);return ' ';}newtok();if((func &STR_FUNC_EXPAND)&&c== '#'){int t=parser_peek_variable_name(parser);if(t) return t;tokadd('#');c=nextc();}pushback(c);if(tokadd_string(func, term, paren,"e->nd_nest,&enc)==-1){ruby_sourceline=nd_line(quote);if(func &STR_FUNC_REGEXP){if(parser->eofp) compile_error(PARSER_ARG"unterminated regexp meets end of file");return tREGEXP_END;}else{if(parser->eofp) compile_error(PARSER_ARG"unterminated string meets end of file");return tSTRING_END;}}tokfix();set_yylval_str(STR_NEW3(tok(), toklen(), enc, func));flush_string_content(enc);return tSTRING_CONTENT;}static intparser_heredoc_identifier(struct parser_params *parser){int c=nextc(), term, func=0;long len;if(c== '-'){c=nextc();func=STR_FUNC_INDENT;}switch(c){case '\'':func|=str_squote;goto quoted;case '"': func |= str_dquote; goto quoted; case '`': func |= str_xquote; quoted: newtok(); tokadd(func); term = c; while ((c = nextc()) != -1 && c != term) { if (tokadd_mbchar(c) == -1) return 0; } if (c == -1) { compile_error(PARSER_ARG "unterminated here document identifier"); return 0; } break; default: if (!parser_is_identchar()) { pushback(c); if (func & STR_FUNC_INDENT) { pushback('-'); } return 0; } newtok(); term = '"';tokadd(func|=str_dquote);do{if(tokadd_mbchar(c)==-1) return 0;}while((c=nextc())!=-1 &&parser_is_identchar());pushback(c);break;}tokfix();len=lex_p-lex_pbeg;lex_goto_eol(parser);lex_strterm=rb_node_newnode(NODE_HEREDOC, STR_NEW(tok(), toklen()), len, lex_lastline);nd_set_line(lex_strterm, ruby_sourceline);ripper_flush(parser);return term== '`'?tXSTRING_BEG:tSTRING_BEG;}static voidparser_heredoc_restore(struct parser_params *parser, NODE *here){VALUE line;lex_strterm=0;line=here->nd_orig;lex_lastline=line;lex_pbeg=RSTRING_PTR(line);lex_pend=lex_pbeg+RSTRING_LEN(line);lex_p=lex_pbeg+here->nd_nth;heredoc_end=ruby_sourceline;ruby_sourceline=nd_line(here);dispose_string(here->nd_lit);rb_gc_force_recycle((VALUE) here);ripper_flush(parser);}static intparser_whole_match_p(struct parser_params *parser, const char *eos, long len, int indent){const char *p=lex_pbeg;long n;if(indent){while(*p &&ISSPACE(*p)) p++;}n=lex_pend-(p+len);if(n< 0) return FALSE;if(n > 0 &&p[len]!= '\n'){if(p[len]!= '\r') return FALSE;if(n<=1||p[len+1]!= '\n') return FALSE;}return strncmp(eos, p, len)==0;}#define NUM_SUFFIX_R#define NUM_SUFFIX_I#define NUM_SUFFIX_ALLstatic intparser_number_literal_suffix(struct parser_params *parser, int mask){int c, result=0;const char *lastp=lex_p;while((c=nextc())!=-1){if((mask &NUM_SUFFIX_I)&&c== 'i'){result|=(mask &NUM_SUFFIX_I);mask &=~NUM_SUFFIX_I;mask &=~NUM_SUFFIX_R;continue;}if((mask &NUM_SUFFIX_R)&&c== 'r'){result|=(mask &NUM_SUFFIX_R);mask &=~NUM_SUFFIX_R;continue;}if(!ISASCII(c)||ISALPHA(c)||c== '_'){lex_p=lastp;return 0;}pushback(c);break;}return result;}static intparser_set_number_literal(struct parser_params *parser, VALUE v, int type, int suffix){if(suffix &NUM_SUFFIX_I){v=rb_complex_raw(INT2FIX(0), v);type=tIMAGINARY;}set_yylval_literal(v);return type;}static intparser_set_integer_literal(struct parser_params *parser, VALUE v, int suffix){int type=tINTEGER;if(suffix &NUM_SUFFIX_R){v=rb_rational_raw1(v);type=tRATIONAL;}return set_number_literal(v, type, suffix);}#define dispatch_heredoc_end() static intparser_here_document(struct parser_params *parser, NODE *here){int c, func, indent=0;const char *eos,*p,*pend;long len;VALUE str=0;rb_encoding *enc=current_enc;eos=RSTRING_PTR(here->nd_lit);len=RSTRING_LEN(here->nd_lit)-1;indent=(func=*eos++)&STR_FUNC_INDENT;if((c=nextc())==-1){error:compile_error(PARSER_ARG"can't find string \"%s\" anywhere before EOF", eos);restore:heredoc_restore(lex_strterm);return 0;}if(was_bol()&&whole_match_p(eos, len, indent)){dispatch_heredoc_end();heredoc_restore(lex_strterm);return tSTRING_END;}if(!(func &STR_FUNC_EXPAND)){do{p=RSTRING_PTR(lex_lastline);pend=lex_pend;if(pend > p){switch(pend[-1]){case '\n':if(--pend==p||pend[-1]!= '\r'){pend++;break;}case '\r':--pend;}}if(str) rb_str_cat(str, p, pend-p);else str=STR_NEW(p, pend-p);if(pend< lex_pend) rb_str_cat(str,"\n", 1);lex_goto_eol(parser);if(nextc()==-1){if(str) dispose_string(str);goto error;}}while(!whole_match_p(eos, len, indent));}else{newtok();if(c== '#'){int t=parser_peek_variable_name(parser);if(t) return t;tokadd('#');c=nextc();}do{pushback(c);if((c=tokadd_string(func, '\n', 0, NULL,&enc))==-1){if(parser->eofp) goto error;goto restore;}if(c!= '\n'){set_yylval_str(STR_NEW3(tok(), toklen(), enc, func));flush_string_content(enc);return tSTRING_CONTENT;}tokadd(nextc());if((c=nextc())==-1) goto error;}while(!whole_match_p(eos, len, indent));str=STR_NEW3(tok(), toklen(), enc, func);}dispatch_heredoc_end();heredoc_restore(lex_strterm);lex_strterm=NEW_STRTERM(-1, 0, 0);set_yylval_str(str);return tSTRING_CONTENT;}static voidarg_ambiguous_gen(struct parser_params *parser){rb_warning0("ambiguous first argument; put parentheses or even spaces");}#define arg_ambiguous() static IDformal_argument_gen(struct parser_params *parser, ID lhs){if(!is_local_id(lhs)) yyerror("formal argument must be local variable");shadowing_lvar(lhs);return lhs;}static intlvar_defined_gen(struct parser_params *parser, ID id){return(dyna_in_block()&&dvar_defined_get(id))||local_id(id);}static longparser_encode_length(struct parser_params *parser, const char *name, long len){long nlen;if(len > 5 &&name[nlen=len-5]== '-'){if(rb_memcicmp(name+nlen+1,"unix", 4)==0) return nlen;}if(len > 4 &&name[nlen=len-4]== '-'){if(rb_memcicmp(name+nlen+1,"dos", 3)==0) return nlen;if(rb_memcicmp(name+nlen+1,"mac", 3)==0 &&!(len==8 &&rb_memcicmp(name,"utf8-mac", len)==0)) return nlen;}return len;}static voidparser_set_encode(struct parser_params *parser, const char *name){int idx=rb_enc_find_index(name);rb_encoding *enc;VALUE excargs[3];if(idx< 0){excargs[1]=rb_sprintf("unknown encoding name: %s", name);error:excargs[0]=rb_eArgError;excargs[2]=rb_make_backtrace();rb_ary_unshift(excargs[2], rb_sprintf("%s:%d", ruby_sourcefile, ruby_sourceline));rb_exc_raise(rb_make_exception(3, excargs));}enc=rb_enc_from_index(idx);if(!rb_enc_asciicompat(enc)){excargs[1]=rb_sprintf("%s is not ASCII compatible", rb_enc_name(enc));goto error;}parser->enc=enc;if(ruby_debug_lines){VALUE lines=ruby_debug_lines;long i, n=RARRAY_LEN(lines);for(i=0;i< n;++i){rb_enc_associate_index(RARRAY_AREF(lines, i), idx);}}}static intcomment_at_top(struct parser_params *parser){const char *p=lex_pbeg,*pend=lex_p-1;if(parser->line_count!=(parser->has_shebang?2:1)) return 0;while(p< pend){if(!ISSPACE(*p)) return 0;p++;}return 1;}typedef long(*rb_magic_comment_length_t)(struct parser_params *parser, const char *name, long len);typedef void(*rb_magic_comment_setter_t)(struct parser_params *parser, const char *name, const char *val);static voidmagic_comment_encoding(struct parser_params *parser, const char *name, const char *val){if(!comment_at_top(parser)){return;}parser_set_encode(parser, val);}static voidparser_set_token_info(struct parser_params *parser, const char *name, const char *val){int *p=&parser->parser_token_info_enabled;switch(*val){case 't':case 'T':if(strcasecmp(val,"true")==0){*p=TRUE;return;}break;case 'f':case 'F':if(strcasecmp(val,"false")==0){*p=FALSE;return;}break;}rb_compile_warning(ruby_sourcefile, ruby_sourceline,"invalid value for %s: %s", name, val);}struct magic_comment{const char *name;rb_magic_comment_setter_t func;rb_magic_comment_length_t length;};static const struct magic_comment magic_comments[]={{"coding", magic_comment_encoding, parser_encode_length},{"encoding", magic_comment_encoding, parser_encode_length},{"warn_indent", parser_set_token_info},};static const char *magic_comment_marker(const char *str, long len){long i=2;while(i< len){switch(str[i]){case '-':if(str[i-1]== '*'&&str[i-2]== '-'){return str+i+1;}i+=2;break;case '*':if(i+1 >=len) return 0;if(str[i+1]!= '-'){i+=4;}else if(str[i-1]!= '-'){i+=2;}else{return str+i+2;}break;default:i+=3;break;}}return 0;}static intparser_magic_comment(struct parser_params *parser, const char *str, long len){VALUE name=0, val=0;const char *beg,*end,*vbeg,*vend;#define str_copy(_s, _p, _n) if(len<=7) return FALSE;if(!(beg=magic_comment_marker(str, len))) return FALSE;if(!(end=magic_comment_marker(beg, str+len-beg))) return FALSE;str=beg;len=end-beg-3;while(len > 0){const struct magic_comment *p=magic_comments;char *s;int i;long n=0;for(;len > 0 &&*str;str++,--len){switch(*str){case '\'':case '"': case ':': case ';': continue; } if (!ISSPACE(*str)) break; } for (beg = str; len > 0; str++, --len) { switch (*str) { case '\'': case '"':case ':':case ';':break;default:if(ISSPACE(*str)) break;continue;}break;}for(end=str;len > 0 &&ISSPACE(*str);str++,--len);if(!len) break;if(*str!= ':') continue;do str++;while(--len > 0 &&ISSPACE(*str));if(!len) break;if(*str== '"') { for (vbeg = ++str; --len > 0 && *str != '"';str++){if(*str== '\\'){--len;++str;}}vend=str;if(len){--len;++str;}}else{for(vbeg=str;len > 0 &&*str!= '"' && *str != ';' && !ISSPACE(*str); --len, str++); vend = str; } while (len > 0 && (*str == ';' || ISSPACE(*str))) --len, str++; n = end - beg; str_copy(name, beg, n); s = RSTRING_PTR(name); for (i = 0; i < n; ++i) { if (s[i] == '-') s[i] = '_'; } do { if (STRNCASECMP(p->name, s, n) == 0) { n = vend - vbeg; if (p->length) { n = (*p->length)(parser, vbeg, n); } str_copy(val, vbeg, n); (*p->func)(parser, s, RSTRING_PTR(val)); break; } } while (++p < magic_comments + numberof(magic_comments)); } return TRUE;}static voidset_file_encoding(struct parser_params *parser, const char *str, const char *send){ int sep = 0; const char *beg = str; VALUE s; for (;;) { if (send - str <= 6) return; switch (str[6]) { case 'C': case 'c': str += 6; continue; case 'O': case 'o': str += 5; continue; case 'D': case 'd': str += 4; continue; case 'I': case 'i': str += 3; continue; case 'N': case 'n': str += 2; continue; case 'G': case 'g': str += 1; continue; case '=': case ':': sep = 1; str += 6; break; default: str += 6; if (ISSPACE(*str)) break; continue; } if (STRNCASECMP(str-6, "coding", 6) == 0) break; } for (;;) { do { if (++str >= send) return; } while (ISSPACE(*str)); if (sep) break; if (*str != '=' && *str != ':') return; sep = 1; str++; } beg = str; while ((*str == '-' || *str == '_' || ISALNUM(*str)) && ++str < send); s = rb_str_new(beg, parser_encode_length(parser, beg, str - beg)); parser_set_encode(parser, RSTRING_PTR(s)); rb_str_resize(s, 0);}static voidparser_prepare(struct parser_params *parser){ int c = nextc(); switch (c) { case '#': if (peek('!')) parser->has_shebang = 1; break; case 0xef: if (lex_pend - lex_p >= 2 && (unsigned char)lex_p[0] == 0xbb && (unsigned char)lex_p[1] == 0xbf) { parser->enc = rb_utf8_encoding(); lex_p += 2; lex_pbeg = lex_p; return; } break; case EOF: return; } pushback(c); parser->enc = rb_enc_get(lex_lastline);}#define IS_ARG() #define IS_END() #define IS_BEG() #define IS_SPCARG(c) #define IS_LABEL_POSSIBLE() #define IS_LABEL_SUFFIX(n) #define IS_AFTER_OPERATOR() #define ambiguous_operator(op, syn) #define warn_balanced(op, syn) static intparser_yylex(struct parser_params *parser){ register int c; int space_seen = 0; int cmd_state; enum lex_state_e last_state; rb_encoding *enc; int mb; if (lex_strterm) { int token; if (nd_type(lex_strterm) == NODE_HEREDOC) { token = here_document(lex_strterm); if (token == tSTRING_END) { lex_strterm = 0; lex_state = EXPR_END; } } else { token = parse_string(lex_strterm); if (token == tSTRING_END || token == tREGEXP_END) { rb_gc_force_recycle((VALUE)lex_strterm); lex_strterm = 0; lex_state = EXPR_END; } } return token; } cmd_state = command_start; command_start = FALSE; retry: last_state = lex_state; switch (c = nextc()) { case '\0': case '\004': case '\032': case -1: return 0; case ' ': case '\t': case '\f': case '\r': case '\13': space_seen = 1; goto retry; case '#': if (!parser_magic_comment(parser, lex_p, lex_pend - lex_p)) { if (comment_at_top(parser)) { set_file_encoding(parser, lex_p, lex_pend); } } lex_p = lex_pend; case '\n': if (IS_lex_state(EXPR_BEG | EXPR_VALUE | EXPR_CLASS | EXPR_FNAME | EXPR_DOT | EXPR_LABELARG)) { if (IS_lex_state(EXPR_LABELARG) && parser->parser_in_kwarg) { goto normal_newline; } goto retry; } while ((c = nextc())) { switch (c) { case ' ': case '\t': case '\f': case '\r': case '\13': space_seen = 1; break; case '.': { if ((c = nextc()) != '.') { pushback(c); pushback('.'); goto retry; } } default: --ruby_sourceline; lex_nextline = lex_lastline; case -1: lex_goto_eol(parser); goto normal_newline; } } normal_newline: command_start = TRUE; lex_state = EXPR_BEG; return '\n'; case '*': if ((c = nextc()) == '*') { if ((c = nextc()) == '=') { set_yylval_id(tPOW); lex_state = EXPR_BEG; return tOP_ASGN; } pushback(c); if (IS_SPCARG(c)) { rb_warning0("`**'interpreted as argument prefix"); c = tDSTAR; } else if (IS_BEG()) { c = tDSTAR; } else { warn_balanced("**", "argument prefix"); c = tPOW; } } else { if (c == '=') { set_yylval_id('*'); lex_state = EXPR_BEG; return tOP_ASGN; } pushback(c); if (IS_SPCARG(c)) { rb_warning0("`*'interpreted as argument prefix"); c = tSTAR; } else if (IS_BEG()) { c = tSTAR; } else { warn_balanced("*", "argument prefix"); c = '*'; } } lex_state = IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG; return c; case '!': c = nextc(); if (IS_AFTER_OPERATOR()) { lex_state = EXPR_ARG; if (c == '@') { return '!'; } } else { lex_state = EXPR_BEG; } if (c == '=') { return tNEQ; } if (c == '~') { return tNMATCH; } pushback(c); return '!'; case '=': if (was_bol()) { if (strncmp(lex_p, "begin", 5) == 0 && ISSPACE(lex_p[5])) { for (;;) { lex_goto_eol(parser); c = nextc(); if (c == -1) { compile_error(PARSER_ARG "embedded document meets end of file"); return 0; } if (c != '=') continue; if (strncmp(lex_p, "end", 3) == 0 && (lex_p + 3 == lex_pend || ISSPACE(lex_p[3]))) { break; } } lex_goto_eol(parser); goto retry; } } lex_state = IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG; if ((c = nextc()) == '=') { if ((c = nextc()) == '=') { return tEQQ; } pushback(c); return tEQ; } if (c == '~') { return tMATCH; } else if (c == '>') { return tASSOC; } pushback(c); return '='; case '<': last_state = lex_state; c = nextc(); if (c == '<' && !IS_lex_state(EXPR_DOT | EXPR_CLASS) && !IS_END() && (!IS_ARG() || space_seen)) { int token = heredoc_identifier(); if (token) return token; } if (IS_AFTER_OPERATOR()) { lex_state = EXPR_ARG; } else { if (IS_lex_state(EXPR_CLASS)) command_start = TRUE; lex_state = EXPR_BEG; } if (c == '=') { if ((c = nextc()) == '>') { return tCMP; } pushback(c); return tLEQ; } if (c == '<') { if ((c = nextc()) == '=') { set_yylval_id(tLSHFT); lex_state = EXPR_BEG; return tOP_ASGN; } pushback(c); warn_balanced("<<", "here document"); return tLSHFT; } pushback(c); return '<'; case '>': lex_state = IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG; if ((c = nextc()) == '=') { return tGEQ; } if (c == '>') { if ((c = nextc()) == '=') { set_yylval_id(tRSHFT); lex_state = EXPR_BEG; return tOP_ASGN; } pushback(c); return tRSHFT; } pushback(c); return '>'; case '"':lex_strterm=NEW_STRTERM(str_dquote, '"', 0); return tSTRING_BEG; case '`': if (IS_lex_state(EXPR_FNAME)) { lex_state = EXPR_ENDFN; return c; } if (IS_lex_state(EXPR_DOT)) { if (cmd_state) lex_state = EXPR_CMDARG; else lex_state = EXPR_ARG; return c; } lex_strterm = NEW_STRTERM(str_xquote, '`', 0); return tXSTRING_BEG; case '\'': lex_strterm = NEW_STRTERM(str_squote, '\'', 0); return tSTRING_BEG; case '?': if (IS_END()) { lex_state = EXPR_VALUE; return '?'; } c = nextc(); if (c == -1) { compile_error(PARSER_ARG "incomplete character syntax"); return 0; } if (rb_enc_isspace(c, current_enc)) { if (!IS_ARG()) { int c2 = 0; switch (c) { case ' ': c2 = 's'; break; case '\n': c2 = 'n'; break; case '\t': c2 = 't'; break; case '\v': c2 = 'v'; break; case '\r': c2 = 'r'; break; case '\f': c2 = 'f'; break; } if (c2) { rb_warnI("invalid character syntax;use?\\%c", c2); } } ternary: pushback(c); lex_state = EXPR_VALUE; return '?'; } newtok(); enc = current_enc; if (!parser_isascii()) { if (tokadd_mbchar(c) == -1) return 0; } else if ((rb_enc_isalnum(c, current_enc) || c == '_') && lex_p < lex_pend && is_identchar(lex_p, lex_pend, current_enc)) { goto ternary; } else if (c == '\\') { if (peek('u')) { nextc(); c = parser_tokadd_utf8(parser, &enc, 0, 0, 0); if (0x80 <= c) { tokaddmbc(c, enc); } else { tokadd(c); } } else if (!lex_eol_p() && !(c = *lex_p, ISASCII(c))) { nextc(); if (tokadd_mbchar(c) == -1) return 0; } else { c = read_escape(0, &enc); tokadd(c); } } else { tokadd(c); } tokfix(); set_yylval_str(STR_NEW3(tok(), toklen(), enc, 0)); lex_state = EXPR_END; return tCHAR; case '&': if ((c = nextc()) == '&') { lex_state = EXPR_BEG; if ((c = nextc()) == '=') { set_yylval_id(tANDOP); lex_state = EXPR_BEG; return tOP_ASGN; } pushback(c); return tANDOP; } else if (c == '=') { set_yylval_id('&'); lex_state = EXPR_BEG; return tOP_ASGN; } pushback(c); if (IS_SPCARG(c)) { rb_warning0("`&'interpreted as argument prefix"); c = tAMPER; } else if (IS_BEG()) { c = tAMPER; } else { warn_balanced("&", "argument prefix"); c = '&'; } lex_state = IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG; return c; case '|': if ((c = nextc()) == '|') { lex_state = EXPR_BEG; if ((c = nextc()) == '=') { set_yylval_id(tOROP); lex_state = EXPR_BEG; return tOP_ASGN; } pushback(c); return tOROP; } if (c == '=') { set_yylval_id('|'); lex_state = EXPR_BEG; return tOP_ASGN; } lex_state = IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG; pushback(c); return '|'; case '+': c = nextc(); if (IS_AFTER_OPERATOR()) { lex_state = EXPR_ARG; if (c == '@') { return tUPLUS; } pushback(c); return '+'; } if (c == '=') { set_yylval_id('+'); lex_state = EXPR_BEG; return tOP_ASGN; } if (IS_BEG() || (IS_SPCARG(c) && arg_ambiguous())) { lex_state = EXPR_BEG; pushback(c); if (c != -1 && ISDIGIT(c)) { c = '+'; goto start_num; } return tUPLUS; } lex_state = EXPR_BEG; pushback(c); warn_balanced("+", "unary operator"); return '+'; case '-': c = nextc(); if (IS_AFTER_OPERATOR()) { lex_state = EXPR_ARG; if (c == '@') { return tUMINUS; } pushback(c); return '-'; } if (c == '=') { set_yylval_id('-'); lex_state = EXPR_BEG; return tOP_ASGN; } if (c == '>') { lex_state = EXPR_ENDFN; return tLAMBDA; } if (IS_BEG() || (IS_SPCARG(c) && arg_ambiguous())) { lex_state = EXPR_BEG; pushback(c); if (c != -1 && ISDIGIT(c)) { return tUMINUS_NUM; } return tUMINUS; } lex_state = EXPR_BEG; pushback(c); warn_balanced("-", "unary operator"); return '-'; case '.': lex_state = EXPR_BEG; if ((c = nextc()) == '.') { if ((c = nextc()) == '.') { return tDOT3; } pushback(c); return tDOT2; } pushback(c); if (c != -1 && ISDIGIT(c)) { yyerror("no.< digit > floating literal anymore;put 0 before dot"); } lex_state = EXPR_DOT; return '.'; start_num: case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': { int is_float, seen_point, seen_e, nondigit; int suffix; is_float = seen_point = seen_e = nondigit = 0; lex_state = EXPR_END; newtok(); if (c == '-' || c == '+') { tokadd(c); c = nextc(); } if (c == '0') {#define no_digits() int start = toklen(); c = nextc(); if (c == 'x' || c == 'X') { c = nextc(); if (c != -1 && ISXDIGIT(c)) { do { if (c == '_') { if (nondigit) break; nondigit = c; continue; } if (!ISXDIGIT(c)) break; nondigit = 0; tokadd(c); } while ((c = nextc()) != -1); } pushback(c); tokfix(); if (toklen() == start) { no_digits(); } else if (nondigit) goto trailing_uc; suffix = number_literal_suffix(NUM_SUFFIX_ALL); return set_integer_literal(rb_cstr_to_inum(tok(), 16, FALSE), suffix); } if (c == 'b' || c == 'B') { c = nextc(); if (c == '0' || c == '1') { do { if (c == '_') { if (nondigit) break; nondigit = c; continue; } if (c != '0' && c != '1') break; nondigit = 0; tokadd(c); } while ((c = nextc()) != -1); } pushback(c); tokfix(); if (toklen() == start) { no_digits(); } else if (nondigit) goto trailing_uc; suffix = number_literal_suffix(NUM_SUFFIX_ALL); return set_integer_literal(rb_cstr_to_inum(tok(), 2, FALSE), suffix); } if (c == 'd' || c == 'D') { c = nextc(); if (c != -1 && ISDIGIT(c)) { do { if (c == '_') { if (nondigit) break; nondigit = c; continue; } if (!ISDIGIT(c)) break; nondigit = 0; tokadd(c); } while ((c = nextc()) != -1); } pushback(c); tokfix(); if (toklen() == start) { no_digits(); } else if (nondigit) goto trailing_uc; suffix = number_literal_suffix(NUM_SUFFIX_ALL); return set_integer_literal(rb_cstr_to_inum(tok(), 10, FALSE), suffix); } if (c == '_') { goto octal_number; } if (c == 'o' || c == 'O') { c = nextc(); if (c == -1 || c == '_' || !ISDIGIT(c)) { no_digits(); } } if (c >= '0' && c <= '7') { octal_number: do { if (c == '_') { if (nondigit) break; nondigit = c; continue; } if (c < '0' || c > '9') break; if (c > '7') goto invalid_octal; nondigit = 0; tokadd(c); } while ((c = nextc()) != -1); if (toklen() > start) { pushback(c); tokfix(); if (nondigit) goto trailing_uc; suffix = number_literal_suffix(NUM_SUFFIX_ALL); return set_integer_literal(rb_cstr_to_inum(tok(), 8, FALSE), suffix); } if (nondigit) { pushback(c); goto trailing_uc; } } if (c > '7' && c <= '9') { invalid_octal: yyerror("Invalid octal digit"); } else if (c == '.' || c == 'e' || c == 'E') { tokadd('0'); } else { pushback(c); suffix = number_literal_suffix(NUM_SUFFIX_ALL); return set_integer_literal(INT2FIX(0), suffix); } } for (;;) { switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': nondigit = 0; tokadd(c); break; case '.': if (nondigit) goto trailing_uc; if (seen_point || seen_e) { goto decode_num; } else { int c0 = nextc(); if (c0 == -1 || !ISDIGIT(c0)) { pushback(c0); goto decode_num; } c = c0; } seen_point = toklen(); tokadd('.'); tokadd(c); is_float++; nondigit = 0; break; case 'e': case 'E': if (nondigit) { pushback(c); c = nondigit; goto decode_num; } if (seen_e) { goto decode_num; } nondigit = c; c = nextc(); if (c != '-' && c != '+' && !ISDIGIT(c)) { pushback(c); nondigit = 0; goto decode_num; } tokadd(nondigit); seen_e++; is_float++; tokadd(c); nondigit = (c == '-' || c == '+') ? c : 0; break; case '_': if (nondigit) goto decode_num; nondigit = c; break; default: goto decode_num; } c = nextc(); } decode_num: pushback(c); if (nondigit) { char tmp[30]; trailing_uc: snprintf(tmp, sizeof(tmp), "trailing`%c'in number", nondigit); yyerror(tmp); } tokfix(); if (is_float) { int type = tFLOAT; VALUE v; suffix = number_literal_suffix(seen_e ? NUM_SUFFIX_I : NUM_SUFFIX_ALL); if (suffix & NUM_SUFFIX_R) { char *point = &tok()[seen_point]; size_t fraclen = toklen()-seen_point-1; type = tRATIONAL; memmove(point, point+1, fraclen+1); v = rb_cstr_to_inum(tok(), 10, FALSE); v = rb_rational_new(v, rb_int_positive_pow(10, fraclen)); } else { double d = strtod(tok(), 0); if (errno == ERANGE) { rb_warningS("Float%s out of range", tok()); errno = 0; } v = DBL2NUM(d); } return set_number_literal(v, type, suffix); } suffix = number_literal_suffix(NUM_SUFFIX_ALL); return set_integer_literal(rb_cstr_to_inum(tok(), 10, FALSE), suffix); } case ')': case '] | __pad18__ |
| ONIG_EXTERN const UChar | OnigEncISO_8859_1_ToLowerCaseTable [] |
| ONIG_EXTERN const UChar | OnigEncISO_8859_1_ToUpperCaseTable [] |
| ONIG_EXTERN OnigEncoding | OnigEncDefaultCharEncoding |
| ONIG_EXTERN const UChar | OnigEncAsciiToLowerCaseTable [] |
| ONIG_EXTERN const UChar | OnigEncAsciiToUpperCaseTable [] |
| ONIG_EXTERN const unsigned short | OnigEncAsciiCtypeTable [] |
| pure parser lex | param |
| top_compstmt | __pad0__ |
| fixup_nodes & | deferred_nodes |
| top_stmts | __pad1__ = $1 |
| top_stmt | |
| top_stmt | __pad2__ |
| top_stmt | bodystmt = NEW_BEGIN(0) |
| compstmt | __pad3__ |
| stmts | __pad4__ = $1 |
| stmt_or_begin | |
| error | stmt |
| stmt_or_begin | __pad5__ |
| keyword_BEGIN | |
| command_asgn | __pad6__ |
| lhs | |
| expr | __pad7__ |
| expr expr keyword_or | expr |
| command_call | |
| arg | |
| expr_value | __pad8__ |
| command_call | __pad9__ |
| block_command | __pad10__ |
| block_command | cmd_brace_block |
| < num > opt_block_param | compstmt |
| fcall | __pad11__ |
| command | __pad12__ |
| nd_args = $2 | |
| nd_iter = $1 | |
| primary_value operation2 command_args prec | tLOWEST |
| keyword_super | command_args |
| keyword_return | call_args |
| mlhs | __pad13__ |
| mlhs_inner | __pad14__ |
| mlhs_inner | mlhs_basic |
| mlhs_inner mlhs_head | mlhs_item |
| mlhs_head tSTAR | mlhs_node |
| mlhs_head tSTAR | mlhs_post |
| mlhs_head | tSTAR |
| mlhs_item | __pad15__ |
| mlhs_head | __pad16__ |
| mlhs_node | __pad17__ |
| mlhs_node | keyword_variable |
| case | __pad19__ |
| else | lex_state = EXPR_ENDARG |
| return | c |
| case | __pad20__ |
| return | tSYMBEG |
| case | __pad21__ |
| case return | tREGEXP_BEG |
| return | |
| case | __pad22__ |
| return | tOP_ASGN |
| case | |
| __pad23__ | |
| command_start = TRUE | |
| __pad24__ | |
| case | __pad25__ |
| else | |
| #define ambiguous_operator | ( | op, | |
| syn | |||
| ) |
| #define arg_ambiguous | ( | ) | (arg_ambiguous_gen(parser), 1) |
| #define arg_append | ( | h, | |
| t | |||
| ) | arg_append_gen(parser,(h),(t)) |
| #define arg_concat | ( | h, | |
| t | |||
| ) | arg_concat_gen(parser,(h),(t)) |
| #define arg_var | ( | id | ) | arg_var_gen(parser, (id)) |
| #define aryset | ( | node1, | |
| node2 | |||
| ) | aryset_gen(parser, (node1), (node2)) |
| #define assignable | ( | id, | |
| node | |||
| ) | assignable_gen(parser, (id), (node)) |
| #define assignable_result | ( | x | ) | (x) |
| #define attrset | ( | node, | |
| id | |||
| ) | attrset_gen(parser, (node), (id)) |
| #define BITSTACK_LEXPOP | ( | stack | ) | ((stack) = ((stack) >> 1) | ((stack) & 1)) |
| #define BITSTACK_PUSH | ( | stack, | |
| n | |||
| ) | ((stack) = ((stack)<<1)|((n)&1)) |
| #define block_append | ( | h, | |
| t | |||
| ) | block_append_gen(parser,(h),(t)) |
| #define block_dup_check | ( | n1, | |
| n2 | |||
| ) | block_dup_check_gen(parser,(n1),(n2)) |
| #define call_bin_op | ( | recv, | |
| id, | |||
| arg1 | |||
| ) | call_bin_op_gen(parser, (recv),(id),(arg1)) |
| #define call_uni_op | ( | recv, | |
| id | |||
| ) | call_uni_op_gen(parser, (recv),(id)) |
| #define CMDARG_LEXPOP | ( | ) | BITSTACK_LEXPOP(cmdarg_stack) |
| #define CMDARG_P | ( | ) | BITSTACK_SET_P(cmdarg_stack) |
| #define CMDARG_POP | ( | ) | BITSTACK_POP(cmdarg_stack) |
| #define CMDARG_PUSH | ( | n | ) | BITSTACK_PUSH(cmdarg_stack, (n)) |
| #define compile_error parser->nerr++,rb_compile_error_with_enc |
| #define COND_LEXPOP | ( | ) | BITSTACK_LEXPOP(cond_stack) |
| #define COND_P | ( | ) | BITSTACK_SET_P(cond_stack) |
| #define COND_POP | ( | ) | BITSTACK_POP(cond_stack) |
| #define COND_PUSH | ( | n | ) | BITSTACK_PUSH(cond_stack, (n)) |
| #define dispatch_heredoc_end | ( | ) | ((void)0) |
| #define dsym_node | ( | node | ) | dsym_node_gen(parser, (node)) |
| #define dvar_curr | ( | id | ) | dvar_curr_gen(parser, (id)) |
| #define dvar_defined | ( | id | ) | dvar_defined_gen(parser, (id), 0) |
| #define dvar_defined_get | ( | id | ) | dvar_defined_gen(parser, (id), 1) |
| #define dyna_in_block | ( | ) | dyna_in_block_gen(parser) |
| #define dyna_pop | ( | node | ) | dyna_pop_gen(parser, (node)) |
| #define dyna_push | ( | ) | dyna_push_gen(parser) |
| #define ENABLE_SELECTOR_NAMESPACE 0 |
| #define ENC_SINGLE | ( | cr | ) | ((cr)==ENC_CODERANGE_7BIT) |
| #define ESCAPE_CONTROL 1 |
| #define ESCAPE_META 2 |
| #define evstr2dstr | ( | n | ) | evstr2dstr_gen(parser,(n)) |
| #define flush_string_content | ( | enc | ) | ((void)(enc)) |
| #define formal_argument | ( | id | ) | formal_argument_gen(parser, (id)) |
| #define gettable | ( | id | ) | gettable_gen(parser,(id)) |
| #define here_document | ( | n | ) | parser_here_document(parser,(n)) |
| #define heredoc_identifier | ( | ) | parser_heredoc_identifier(parser) |
| #define heredoc_restore | ( | n | ) | parser_heredoc_restore(parser,(n)) |
| #define id_type | ( | id | ) | (is_notop_id(id) ? (int)((id)&ID_SCOPE_MASK) : -1) |
| #define IDSET_ATTRSET_FOR_INTERN (~(~0U<<ID_SCOPE_MASK) & ~(1U<<ID_ATTRSET)) |
| #define IDSET_ATTRSET_FOR_SYNTAX ((1U<<ID_LOCAL)|(1U<<ID_CONST)) |
| #define internal_id | ( | ) | internal_id_gen(parser) |
| #define IS_AFTER_OPERATOR | ( | ) | IS_lex_state(EXPR_FNAME | EXPR_DOT) |
| #define IS_ARG | ( | ) | IS_lex_state(EXPR_ARG_ANY) |
| #define is_asgn_or_id | ( | id | ) |
| #define is_attrset_id | ( | id | ) | (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_ATTRSET) |
| #define IS_BEG | ( | ) | IS_lex_state(EXPR_BEG_ANY) |
| #define is_class_id | ( | id | ) | (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_CLASS) |
| #define is_const_id | ( | id | ) | (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_CONST) |
| #define IS_END | ( | ) | IS_lex_state(EXPR_END_ANY) |
| #define is_global_id | ( | id | ) | (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_GLOBAL) |
| #define is_identchar | ( | p, | |
| e, | |||
| enc | |||
| ) | (rb_enc_isalnum((unsigned char)(*(p)),(enc)) || (*(p)) == '_' || !ISASCII(*(p))) |
| #define is_instance_id | ( | id | ) | (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_INSTANCE) |
| #define is_junk_id | ( | id | ) | (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_JUNK) |
| #define IS_LABEL_POSSIBLE | ( | ) | ((IS_lex_state(EXPR_BEG | EXPR_ENDFN) && !cmd_state) || IS_ARG()) |
| #define IS_lex_state | ( | ls | ) | IS_lex_state_for(lex_state, (ls)) |
| #define is_local_id | ( | id | ) | (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_LOCAL) |
| #define is_notop_id | ( | id | ) | ((id)>tLAST_OP_ID) |
| #define lex_goto_eol | ( | parser | ) | ((parser)->parser_lex_p = (parser)->parser_lex_pend) |
| #define lex_strterm (parser->parser_lex_strterm) |
| #define list_append | ( | l, | |
| i | |||
| ) | list_append_gen(parser,(l),(i)) |
| #define list_concat | ( | h, | |
| t | |||
| ) | list_concat_gen(parser,(h),(t)) |
| #define literal_concat | ( | h, | |
| t | |||
| ) | literal_concat_gen(parser,(h),(t)) |
| #define local_id | ( | id | ) | local_id_gen(parser, (id)) |
| #define local_pop | ( | ) | local_pop_gen(parser) |
| #define local_push | ( | top | ) | local_push_gen(parser,(top)) |
| #define local_tbl | ( | ) | local_tbl_gen(parser) |
| #define local_var | ( | id | ) | local_var_gen(parser, (id)) |
| #define lvar_defined | ( | id | ) | lvar_defined_gen(parser, (id)) |
| #define match_op | ( | node1, | |
| node2 | |||
| ) | match_op_gen(parser, (node1), (node2)) |
| #define mixed_error | ( | enc1, | |
| enc2 | |||
| ) |
| #define mixed_escape | ( | beg, | |
| enc1, | |||
| enc2 | |||
| ) |
| #define nd_term | ( | node | ) | SIGN_EXTEND((node)->u2.id, CHAR_BIT*2) |
| #define new_args | ( | f, | |
| o, | |||
| r, | |||
| p, | |||
| t | |||
| ) | new_args_gen(parser, (f),(o),(r),(p),(t)) |
| #define new_args_tail | ( | k, | |
| kr, | |||
| b | |||
| ) | new_args_tail_gen(parser, (k),(kr),(b)) |
| #define new_attr_op_assign | ( | lhs, | |
| type, | |||
| attr, | |||
| op, | |||
| rhs | |||
| ) | new_attr_op_assign_gen(parser, (lhs), (attr), (op), (rhs)) |
| #define new_bv | ( | id | ) | new_bv_gen(parser, (id)) |
| #define new_const_op_assign | ( | lhs, | |
| op, | |||
| rhs | |||
| ) | new_const_op_assign_gen(parser, (lhs), (op), (rhs)) |
| #define new_defined | ( | expr | ) | NEW_DEFINED(remove_begin_all(expr)) |
| #define new_evstr | ( | n | ) | new_evstr_gen(parser,(n)) |
| #define new_op_assign | ( | lhs, | |
| op, | |||
| rhs | |||
| ) | new_op_assign_gen(parser, (lhs), (op), (rhs)) |
| #define NEW_STRTERM | ( | func, | |
| term, | |||
| paren | |||
| ) | rb_node_newnode(NODE_STRTERM, (func), (term) | ((paren) << (CHAR_BIT * 2)), 0) |
| #define new_yield | ( | node | ) | new_yield_gen(parser, (node)) |
| #define NEWHEAP | ( | ) | rb_node_newnode(NODE_ALLOCA, 0, (VALUE)parser->heap, 0) |
| #define newtok | ( | ) | parser_newtok(parser) |
| #define nextc | ( | ) | parser_nextc(parser) |
| #define no_digits | ( | ) | do {yyerror("numeric literal without digits"); return 0;} while (0) |
| #define node_assign | ( | node1, | |
| node2 | |||
| ) | node_assign_gen(parser, (node1), (node2)) |
| #define NODE_HEREDOC NODE_ARRAY /* 1, 3 to gc */ |
| #define NODE_STRTERM NODE_ZARRAY /* nothing to gc */ |
| #define NUM_SUFFIX_ALL 3 |
| #define NUM_SUFFIX_I (1<<1) |
| #define NUM_SUFFIX_R (1<<0) |
| #define number_literal_suffix | ( | f | ) | parser_number_literal_suffix(parser, (f)) |
| #define parse_string | ( | n | ) | parser_parse_string(parser,(n)) |
| #define PARSER_ARG ruby_sourcefile, ruby_sourceline, current_enc, |
| #define PARSER_DEBUG 0 |
| #define parser_encoding_name | ( | ) | (current_enc->name) |
| #define parser_is_identchar | ( | ) | (!parser->eofp && is_identchar((lex_p-1),lex_pend,current_enc)) |
| #define parser_mbclen | ( | ) | mbclen((lex_p-1),lex_pend,current_enc) |
| #define parser_precise_mbclen | ( | ) | rb_enc_precise_mbclen((lex_p-1),lex_pend,current_enc) |
| #define parser_warn | ( | node, | |
| mesg | |||
| ) | parser_warn(parser, (node), (mesg)) |
| #define parser_warning | ( | node, | |
| mesg | |||
| ) | parser_warning(parser, (node), (mesg)) |
| #define pushback | ( | c | ) | parser_pushback(parser, (c)) |
| #define rb_backref_error | ( | n | ) | rb_backref_error_gen(parser,(n)) |
| #define rb_compile_error rb_compile_error_with_enc |
| #define rb_node_newnode | ( | type, | |
| a1, | |||
| a2, | |||
| a3 | |||
| ) | node_newnode(parser, (type), (a1), (a2), (a3)) |
| #define rb_warn0 | ( | fmt | ) | rb_compile_warn(ruby_sourcefile, ruby_sourceline, (fmt)) |
| #define rb_warn4S | ( | file, | |
| line, | |||
| fmt, | |||
| a | |||
| ) | rb_compile_warn((file), (line), (fmt), (a)) |
| #define rb_warnI | ( | fmt, | |
| a | |||
| ) | rb_compile_warn(ruby_sourcefile, ruby_sourceline, (fmt), (a)) |
| #define rb_warning0 | ( | fmt | ) | rb_compile_warning(ruby_sourcefile, ruby_sourceline, (fmt)) |
| #define rb_warningS | ( | fmt, | |
| a | |||
| ) | rb_compile_warning(ruby_sourcefile, ruby_sourceline, (fmt), (a)) |
| #define rb_warnS | ( | fmt, | |
| a | |||
| ) | rb_compile_warn(ruby_sourcefile, ruby_sourceline, (fmt), (a)) |
| #define RE_OPTION_ENCODING | ( | e | ) | (((e)&0xff)<<RE_OPTION_ENCODING_SHIFT) |
| #define RE_OPTION_ENCODING_IDX | ( | o | ) | (((o)>>RE_OPTION_ENCODING_SHIFT)&0xff) |
| #define RE_OPTION_ENCODING_NONE | ( | o | ) | ((o)&RE_OPTION_ARG_ENCODING_NONE) |
| #define read_escape | ( | flags, | |
| e | |||
| ) | parser_read_escape(parser, (flags), (e)) |
| #define reduce_nodes | ( | n | ) | reduce_nodes_gen(parser,(n)) |
| #define reg_compile | ( | str, | |
| options | |||
| ) | reg_compile_gen(parser, (str), (options)) |
| #define reg_fragment_check | ( | str, | |
| options | |||
| ) | reg_fragment_check_gen(parser, (str), (options)) |
| #define reg_fragment_setenc | ( | str, | |
| options | |||
| ) | reg_fragment_setenc_gen(parser, (str), (options)) |
| #define reg_named_capture_assign | ( | regexp, | |
| match | |||
| ) | reg_named_capture_assign_gen(parser,(regexp),(match)) |
| #define regx_options | ( | ) | parser_regx_options(parser) |
| #define ret_args | ( | node | ) | ret_args_gen(parser, (node)) |
| #define ripper_flush | ( | p | ) | (void)(p) |
| #define ruby_debug_lines (parser->debug_lines) |
| #define ruby_eval_tree_begin (parser->parser_eval_tree_begin) |
| #define ruby_sourcefile_string (parser->parser_ruby_sourcefile_string) |
| #define set_integer_literal | ( | v, | |
| f | |||
| ) | parser_set_integer_literal(parser, (v), (f)) |
| #define set_number_literal | ( | v, | |
| t, | |||
| f | |||
| ) | parser_set_number_literal(parser, (v), (t), (f)) |
| #define set_yylval_id | ( | x | ) | (yylval.id = (x)) |
| #define set_yylval_literal | ( | x | ) | (yylval.node = NEW_LIT(x)) |
| #define set_yylval_name | ( | x | ) | (yylval.id = (x)) |
| #define set_yylval_node | ( | x | ) | (yylval.node = (x)) |
| #define set_yylval_num | ( | x | ) | (yylval.num = (x)) |
| #define set_yylval_str | ( | x | ) | (yylval.node = NEW_STR(x)) |
| #define shadowing_lvar | ( | name | ) | shadowing_lvar_gen(parser, (name)) |
| #define SIGN_EXTEND | ( | x, | |
| n | |||
| ) | (((1<<(n)-1)^((x)&~(~0<<(n))))-(1<<(n)-1)) |
| #define SPECIAL_PUNCT | ( | idx | ) |
| #define str_copy | ( | _s, | |
| _p, | |||
| _n | |||
| ) |
| #define STR_FUNC_ESCAPE 0x01 |
| #define STR_FUNC_EXPAND 0x02 |
| #define STR_FUNC_INDENT 0x20 |
| #define STR_FUNC_QWORDS 0x08 |
| #define STR_FUNC_REGEXP 0x04 |
| #define STR_FUNC_SYMBOL 0x10 |
| #define STR_NEW | ( | p, | |
| n | |||
| ) | rb_enc_str_new((p),(n),current_enc) |
| #define STR_NEW0 | ( | ) | rb_enc_str_new(0,0,current_enc) |
| #define STR_NEW2 | ( | p | ) | rb_enc_str_new((p),strlen(p),current_enc) |
| #define STR_NEW3 | ( | p, | |
| n, | |||
| e, | |||
| func | |||
| ) | parser_str_new((p),(n),(e),(func),current_enc) |
| #define subnodes | ( | n1, | |
| n2 | |||
| ) |
| #define tok | ( | ) | tokenbuf |
| #define tok_hex | ( | numlen | ) | parser_tok_hex(parser, (numlen)) |
| #define TOK_INTERN | ( | mb | ) | rb_intern3(tok(), toklen(), current_enc) |
| #define tokadd | ( | c | ) | parser_tokadd(parser, (c)) |
| #define tokadd_escape | ( | e | ) | parser_tokadd_escape(parser, (e)) |
| #define tokadd_mbchar | ( | c | ) | parser_tokadd_mbchar(parser, (c)) |
| #define tokadd_string | ( | f, | |
| t, | |||
| p, | |||
| n, | |||
| e | |||
| ) | parser_tokadd_string(parser,(f),(t),(p),(n),(e)) |
| #define tokaddmbc | ( | c, | |
| enc | |||
| ) | parser_tokaddmbc(parser, (c), (enc)) |
| #define token_info_pop | ( | token | ) | (RTEST(ruby_verbose) ? token_info_pop(parser, (token)) : (void)0) |
| #define token_info_push | ( | token | ) | (RTEST(ruby_verbose) ? token_info_push(parser, (token)) : (void)0) |
| #define toklen | ( | ) | tokidx |
| #define tokspace | ( | n | ) | parser_tokspace(parser, (n)) |
| #define value_expr | ( | node | ) | value_expr_gen(parser, (node) = remove_begin(node)) |
| #define void_expr | ( | node | ) | void_expr0((node) = remove_begin(node)) |
| #define void_expr0 | ( | node | ) | void_expr_gen(parser, (node)) |
| #define void_stmts | ( | node | ) | void_stmts_gen(parser, (node)) |
| #define warn_balanced | ( | op, | |
| syn | |||
| ) |
| #define whole_match_p | ( | e, | |
| l, | |||
| i | |||
| ) | parser_whole_match_p(parser,(e),(l),(i)) |
| #define YYCALLOC | ( | nelem, | |
| size | |||
| ) | rb_parser_calloc(parser, (nelem), (size)) |
| #define YYDEBUG 1 |
| #define yyerror | ( | msg | ) | parser_yyerror(parser, (msg)) |
| #define YYERROR_VERBOSE 1 |
| #define YYFREE | ( | ptr | ) | rb_parser_free(parser, (ptr)) |
| #define yylval (*((YYSTYPE*)(parser->parser_yylval))) |
| #define yylval_id | ( | ) | (yylval.id) |
| #define YYMALLOC | ( | size | ) | rb_parser_malloc(parser, (size)) |
| #define YYREALLOC | ( | ptr, | |
| size | |||
| ) | rb_parser_realloc(parser, (ptr), (size)) |
| #define YYSTACK_USE_ALLOCA 0 |
| typedef VALUE stack_type |
| typedef struct token_info token_info |
| enum lex_state_bits |
| enum lex_state_e |
| enum node_type |
| enum rb_econv_result_t |
| enum ruby_id_types |
| enum ruby_method_ids |
| enum ruby_special_consts |
| enum ruby_value_type |
| enum st_retval |
| enum st_retval |
| enum yytokentype |
| RUBY_SYMBOL_EXPORT_BEGIN RUBY_EXTERN double acosh | ( | double | ) |
| RUBY_SYMBOL_EXPORT_BEGIN RUBY_EXTERN double acosh | ( | double | ) |
Definition at line 36 of file acosh.c.
References BIG_CRITERIA.
| RUBY_SYMBOL_EXPORT_BEGIN void* alloca | ( | ) |
|
static |
|
static |
|
static |
|
static |
| RUBY_EXTERN double asinh | ( | double | ) |
| RUBY_EXTERN double asinh | ( | double | ) |
Definition at line 52 of file acosh.c.
References BIG_CRITERIA, DBL_MANT_DIG, neg, and SMALL_CRITERIA.
|
static |
| RUBY_EXTERN double atanh | ( | double | ) |
| RUBY_EXTERN double atanh | ( | double | ) |
|
static |
|
static |
|
static |
|
static |
|
static |
| RUBY_EXTERN double cbrt | ( | double | ) |
| RUBY_EXTERN double cbrt | ( | double | ) |
|
static |
| RUBY_EXTERN char* crypt | ( | const char * | , |
| const char * | |||
| ) |
| RUBY_EXTERN char* crypt | ( | const char * | , |
| const char * | |||
| ) |
Definition at line 500 of file crypt.c.
References _PASSWORD_EFMT1, a64toi, C_block::b, constdatablock, cryptresult, des_cipher(), des_setkey(), itoa64, and NULL.
| DEPRECATED | ( | VALUE | rb_big2str0VALUE, int, int | ) |
| DEPRECATED | ( | VALUE | rb_big2ulong_packVALUE x | ) |
| DEPRECATED | ( | void | rb_quad_packchar *, VALUE | ) |
| DEPRECATED | ( | VALUE | rb_quad_unpackconst char *, int | ) |
| DEPRECATED | ( | void | rb_thread_pollingvoid | ) |
| DEPRECATED | ( | int | rb_thread_selectint, fd_set *, fd_set *, fd_set *, struct timeval * | ) |
| DEPRECATED | ( | void | rb_check_safe_strVALUE | ) |
| DEPRECATED | ( | int | rb_proc_exec_nint, VALUE *, const char * | ) |
| DEPRECATED | ( | VALUE | rb_exec_arg_initint argc, VALUE *argv, int accept_shell, struct rb_exec_arg *e | ) |
| DEPRECATED | ( | int | rb_exec_arg_addoptstruct rb_exec_arg *e, VALUE key, VALUE val | ) |
| DEPRECATED | ( | void | rb_exec_arg_fixupstruct rb_exec_arg *e | ) |
| DEPRECATED | ( | int | rb_run_exec_optionsconst struct rb_exec_arg *e, struct rb_exec_arg *s | ) |
| DEPRECATED | ( | int | rb_run_exec_options_errconst struct rb_exec_arg *e, struct rb_exec_arg *s, char *, size_t | ) |
| DEPRECATED | ( | int | rb_execconst struct rb_exec_arg * | ) |
| DEPRECATED | ( | int | rb_exec_errconst struct rb_exec_arg *, char *, size_t | ) |
| DEPRECATED | ( | rb_pid_t | rb_forkint *, int(*)(void *), void *, VALUE | ) |
| DEPRECATED | ( | rb_pid_t | rb_fork_errint *, int(*)(void *, char *, size_t), void *, VALUE, char *, size_t | ) |
| DEPRECATED | ( | VALUE | rb_struct_iv_getVALUE, const char * | ) |
| DEPRECATED | ( | VALUE | rb_thread_blocking_regionrb_blocking_function_t *func, void *data1, rb_unblock_function_t *ubf, void *data2 | ) |
|
static |
| RUBY_EXTERN int dup2 | ( | int | , |
| int | |||
| ) |
| RUBY_EXTERN int dup2 | ( | int | , |
| int | |||
| ) |
|
static |
|
static |
|
static |
| dyna_pop | ( | $< vars > | ) |
|
static |
|
staticread |
| RUBY_EXTERN int eaccess | ( | const char * | , |
| int | |||
| ) |
| RUBY_EXTERN int eaccess | ( | const char * | , |
| int | |||
| ) |
| RUBY_EXTERN double erf | ( | double | ) |
| RUBY_EXTERN double erf | ( | double | ) |
| RUBY_EXTERN double erfc | ( | double | ) |
| RUBY_EXTERN double erfc | ( | double | ) |
|
static |
| RUBY_EXTERN int ffs | ( | int | ) |
| RUBY_EXTERN int ffs | ( | int | ) |
| RUBY_EXTERN int finite | ( | double | ) |
| RUBY_EXTERN int finite | ( | double | ) |
| fixpos | ( | $$, | |
| $1 | |||
| ) | = $3 |
|
static |
| RUBY_EXTERN int flock | ( | int | , |
| int | |||
| ) |
| RUBY_EXTERN int flock | ( | int | , |
| int | |||
| ) |
Definition at line 125 of file flock.c.
References flock_winnt(), NULL, rb_notimplement(), and rb_w32_asynchronize().
|
static |
|
static |
| RUBY_EXTERN double hypot | ( | double | , |
| double | |||
| ) |
| RUBY_EXTERN double hypot | ( | double | , |
| double | |||
| ) |
| if | ( | $2 | ) |
Definition at line 965 of file parse.y.
References NEW_RESCUE.
| if | ( | ! | $$ | ) |
| if | ( | c | = = ')' | ) |
Definition at line 7763 of file parse.y.
References arg_ambiguous, IS_SPCARG, lex_strterm, NEW_STRTERM, str_regexp, and tREGEXP_BEG.
| void Init_BareVM | ( | void | ) |
Definition at line 2757 of file vm.c.
References rb_vm_struct::defined_module_hash, EXIT_FAILURE, Init_native_thread(), MEMZERO, rb_vm_struct::objspace, rb_hash_new(), rb_objspace_alloc(), rb_thread_set_current_raw, ruby_mimmalloc(), ruby_thread_init_stack(), th_init(), rb_thread_struct::vm, and vm_init2().
| void Init_eval_method | ( | void | ) |
Definition at line 1707 of file vm_method.c.
References idRespond_to, idRespond_to_missing, NOEX_PRIVATE, NOEX_PUBLIC, obj_respond_to(), obj_respond_to_missing(), rb_cModule, rb_define_method(), rb_define_private_method(), rb_eException, rb_mKernel, rb_mod_alias_method(), rb_mod_method_defined(), rb_mod_modfunc(), rb_mod_private(), rb_mod_private_method(), rb_mod_private_method_defined(), rb_mod_protected(), rb_mod_protected_method_defined(), rb_mod_public(), rb_mod_public_method(), rb_mod_public_method_defined(), rb_mod_remove_method(), rb_mod_undef_method(), rb_singleton_class(), rb_vm_top_self(), REPLICATE_METHOD, top_private(), and top_public().
| void Init_ext | ( | void | ) |
Definition at line 2 of file dmyext.c.
Referenced by init_libraries_internal(), and process_options().
| void Init_File | ( | void | ) |
Definition at line 5614 of file file.c.
References define_filetest_function(), INT2FIX, LOCK_EX, LOCK_NB, LOCK_SH, LOCK_UN, O_BINARY, O_NONBLOCK, PATH_SEP, Qnil, rb_cIO, rb_cObject, rb_define_alloc_func(), rb_define_class(), rb_define_class_under(), rb_define_const(), rb_define_global_function(), rb_define_method(), rb_define_module(), rb_define_module_under(), rb_define_singleton_method(), rb_f_test(), rb_file_atime(), rb_file_blockdev_p(), rb_file_chardev_p(), rb_file_chmod(), rb_file_chown(), rb_file_ctime(), rb_file_directory_p(), rb_file_executable_p(), rb_file_executable_real_p(), rb_file_exist_p(), rb_file_exists_p(), rb_file_file_p(), rb_file_flock(), rb_file_grpowned_p(), rb_file_identical_p(), rb_file_lstat(), rb_file_mtime(), rb_file_owned_p(), rb_file_path(), rb_file_pipe_p(), rb_file_readable_p(), rb_file_readable_real_p(), rb_file_s_absolute_path(), rb_file_s_atime(), rb_file_s_basename(), rb_file_s_chmod(), rb_file_s_chown(), rb_file_s_ctime(), rb_file_s_dirname(), rb_file_s_expand_path(), rb_file_s_extname(), rb_file_s_ftype(), rb_file_s_join(), rb_file_s_lchmod, rb_file_s_lchown, rb_file_s_link, rb_file_s_lstat(), rb_file_s_mtime(), rb_file_s_path(), rb_file_s_readlink, rb_file_s_realdirpath(), rb_file_s_realpath(), rb_file_s_rename(), rb_file_s_size(), rb_file_s_split(), rb_file_s_stat(), rb_file_s_symlink, rb_file_s_truncate, rb_file_s_umask(), rb_file_s_unlink(), rb_file_s_utime(), rb_file_sgid_p(), rb_file_size(), rb_file_size_p(), rb_file_socket_p(), rb_file_sticky_p(), rb_file_suid_p(), rb_file_symlink_p(), rb_file_truncate, rb_file_world_readable_p(), rb_file_world_writable_p(), rb_file_writable_p(), rb_file_writable_real_p(), rb_file_zero_p(), rb_include_module(), rb_io_stat(), rb_mComparable, rb_obj_freeze(), rb_stat_atime(), rb_stat_b(), rb_stat_blksize(), rb_stat_blocks(), rb_stat_c(), rb_stat_cmp(), rb_stat_ctime(), rb_stat_d(), rb_stat_dev(), rb_stat_dev_major(), rb_stat_dev_minor(), rb_stat_f(), rb_stat_ftype(), rb_stat_gid(), rb_stat_grpowned(), rb_stat_init(), rb_stat_init_copy(), rb_stat_ino(), rb_stat_inspect(), rb_stat_l(), rb_stat_mode(), rb_stat_mtime(), rb_stat_nlink(), rb_stat_owned(), rb_stat_p(), rb_stat_r(), rb_stat_R(), rb_stat_rdev(), rb_stat_rdev_major(), rb_stat_rdev_minor(), rb_stat_S(), rb_stat_s(), rb_stat_s_alloc(), rb_stat_sgid(), rb_stat_size(), rb_stat_sticky(), rb_stat_suid(), rb_stat_uid(), rb_stat_w(), rb_stat_W(), rb_stat_wr(), rb_stat_ww(), rb_stat_x(), rb_stat_X(), rb_stat_z(), rb_str_new2, and rb_usascii_str_new2.
| void Init_heap | ( | void | ) |
Definition at line 1661 of file gc.c.
References finalizer_table, free(), GET_THREAD(), getrusage_time(), heap_add_pages(), heap_eden, ruby_gc_params_t::heap_init_slots, HEAP_OBJ_LIMIT, init_mark_stack(), rb_objspace::invoke_time, malloc, rb_objspace::mark_stack, rb_objspace::oldmalloc_increase_limit, ruby_gc_params_t::oldmalloc_limit_min, rb_objspace::profile, rb_objspace, rb_sigaltstack_size(), rb_objspace::rgengc, and st_init_numtable().
|
static |
Definition at line 14 of file id.c.
References id_core_define_method, id_core_define_singleton_method, id_core_hash_from_ary, id_core_hash_merge_ary, id_core_hash_merge_kwd, id_core_hash_merge_ptr, id_core_set_method_alias, id_core_set_postexe, id_core_set_variable_alias, id_core_undef_method, idCFUNC, idEmptyP, idEqlP, idIFUNC, idNULL, idRespond_to, idRespond_to_missing, rb_usascii_encoding(), and REGISTER_SYMID.
| void Init_native_thread | ( | void | ) |
| void Init_newline | ( | void | ) |
Definition at line 183 of file newline.c.
References rb_cr_newline, rb_crlf_newline, rb_register_transcoder(), and rb_universal_newline.
| void Init_prelude | ( | void | ) |
| void Init_vm_backtrace | ( | void | ) |
Definition at line 991 of file vm_backtrace.c.
References backtrace_alloc(), backtrace_dump_data(), backtrace_load_data(), CLASS_OF, location_absolute_path_m(), location_base_label_m(), location_inspect_m(), location_label_m(), location_lineno_m(), location_path_m(), location_to_str_m(), rb_cArray, rb_cBacktrace, rb_cBacktraceLocation, rb_cObject, rb_cThread, rb_define_alloc_func(), rb_define_class_under(), rb_define_global_function(), rb_define_method(), rb_f_caller(), rb_f_caller_locations(), rb_marshal_define_compat(), rb_undef_alloc_func(), and rb_undef_method().
| void Init_vm_eval | ( | void | ) |
Definition at line 1966 of file vm_eval.c.
References rb_add_method(), rb_cBasicObject, rb_cModule, rb_define_global_function(), rb_define_method(), rb_define_private_method(), rb_f_block_given_p(), rb_f_catch(), rb_f_eval(), rb_f_local_variables(), rb_f_loop(), rb_f_public_send(), rb_f_send(), rb_f_throw(), rb_intern, rb_method_missing(), rb_mKernel, rb_mod_module_eval(), rb_mod_module_exec(), rb_obj_instance_eval(), rb_obj_instance_exec(), and VM_METHOD_TYPE_OPTIMIZED.
|
static |
| RUBY_EXTERN int isinf | ( | double | ) |
| RUBY_EXTERN int isinf | ( | double | ) |
| RUBY_EXTERN int isnan | ( | double | ) |
| RUBY_EXTERN int isnan | ( | double | ) |
Definition at line 22 of file isnan.c.
References double_ne().
| RUBY_EXTERN double lgamma_r | ( | double | , |
| int * | |||
| ) |
Definition at line 63 of file lgamma_r.c.
| RUBY_EXTERN double lgamma_r | ( | double | , |
| int * | |||
| ) |
Definition at line 63 of file lgamma_r.c.
References errno, f, LOG_PI, loggamma(), and PI.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
| RUBY_EXTERN void* memmove | ( | void * | , |
| const void * | , | ||
| size_t | |||
| ) |
| RUBY_EXTERN void* memmove | ( | void * | , |
| const void * | , | ||
| size_t | |||
| ) |
| nd_set_line | ( | $$, | |
| $< num > | |||
| ) |
| fcall nd_set_line | ( | $$, | |
| tokline | |||
| ) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
inlinestatic |
Definition at line 116 of file internal.h.
References CHAR_BIT.
|
inlinestatic |
Definition at line 146 of file internal.h.
References CHAR_BIT.
|
static |
|
static |
| NORETURN | ( | void | rb_cmperrVALUE, VALUE | ) |
| NORETURN | ( | void | rb_invalid_strconst char *, const char * | ) |
| NORETURN | ( | void | rb_error_frozenconst char * | ) |
| NORETURN | ( | void | rb_error_arityint, int, int | ) |
| NORETURN | ( | void | rb_exc_raiseVALUE | ) |
| NORETURN | ( | void | rb_jump_tagint | ) |
| NORETURN | ( | PRINTF_ARGS(void rb_compile_bug(const char *, int, const char *,...), 3, 4) | ) |
| NORETURN | ( | void | rb_async_bug_errnoconst char *, int | ) |
| NORETURN | ( | void | rb_memerrorvoid | ) |
| NORETURN | ( | void | rb_load_failVALUE, const char * | ) |
| NORETURN | ( | void | rb_insecure_operationvoid | ) |
| NORETURN | ( | void | rb_bug_errnoconst char *, int | ) |
| NORETURN | ( | void | rb_sys_failconst char * | ) |
| NORETURN | ( | void | rb_sys_fail_strVALUE | ) |
| NORETURN | ( | void | rb_mod_sys_failVALUE, const char * | ) |
| NORETURN | ( | void | rb_mod_sys_fail_strVALUE, VALUE | ) |
| NORETURN | ( | void | rb_readwrite_sys_failint, const char * | ) |
| NORETURN | ( | void | rb_exitint | ) |
| NORETURN | ( | void | rb_syserr_fail_strint, VALUE | ) |
| NORETURN | ( | void | rb_mod_syserr_failVALUE, int, const char * | ) |
| NORETURN | ( | void | rb_mod_syserr_fail_strVALUE, int, VALUE | ) |
| NORETURN | ( | void | rb_throwconst char *, VALUE | ) |
| ONIG_EXTERN int onigenc_ascii_apply_all_case_fold P_ | ( | (OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void *arg, OnigEncoding enc) | ) |
| ONIG_EXTERN int onigenc_ascii_get_case_fold_codes_by_str P_ | ( | (OnigCaseFoldType flag, const OnigUChar *p, const OnigUChar *end, OnigCaseFoldCodeItem items[], OnigEncoding enc) | ) |
| ONIG_EXTERN int onigenc_apply_all_case_fold_with_map P_ | ( | (int map_size, const OnigPairCaseFoldCodes map[], int ess_tsett_flag, OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void *arg) | ) |
| ONIG_EXTERN int onigenc_get_case_fold_codes_by_str_with_map P_ | ( | (int map_size, const OnigPairCaseFoldCodes map[], int ess_tsett_flag, OnigCaseFoldType flag, const OnigUChar *p, const OnigUChar *end, OnigCaseFoldCodeItem items[]) | ) |
| ONIG_EXTERN int onigenc_not_support_get_ctype_code_range P_ | ( | (OnigCtype ctype, OnigCodePoint *sb_out, const OnigCodePoint *ranges[], OnigEncoding enc) | ) |
| ONIG_EXTERN int onigenc_is_mbc_newline_0x0a P_ | ( | (const UChar *p, const UChar *end, OnigEncoding enc) | ) |
| ONIG_EXTERN int onigenc_ascii_mbc_case_fold P_ | ( | (OnigCaseFoldType flag, const UChar **p, const UChar *end, UChar *lower, OnigEncoding enc) | ) |
| ONIG_EXTERN int onigenc_single_byte_mbc_enc_len P_ | ( | (const UChar *p, const UChar *e, OnigEncoding enc) | ) |
| ONIG_EXTERN OnigCodePoint onigenc_single_byte_mbc_to_code P_ | ( | (const UChar *p, const UChar *end, OnigEncoding enc) | ) |
| ONIG_EXTERN int onigenc_single_byte_code_to_mbclen P_ | ( | (OnigCodePoint code, OnigEncoding enc) | ) |
| ONIG_EXTERN int onigenc_single_byte_code_to_mbc P_ | ( | (OnigCodePoint code, UChar *buf, OnigEncoding enc) | ) |
| ONIG_EXTERN UChar* onigenc_single_byte_left_adjust_char_head P_ | ( | (const UChar *start, const UChar *s, const OnigUChar *end, OnigEncoding enc) | ) |
| ONIG_EXTERN int onigenc_always_true_is_allowed_reverse_match P_ | ( | (const UChar *s, const UChar *end, OnigEncoding enc) | ) |
| ONIG_EXTERN int onigenc_always_false_is_allowed_reverse_match P_ | ( | (const UChar *s, const UChar *end, OnigEncoding enc) | ) |
| ONIG_EXTERN int onigenc_ascii_is_code_ctype P_ | ( | (OnigCodePoint code, unsigned int ctype, OnigEncoding enc) | ) |
| ONIG_EXTERN OnigCodePoint onigenc_mbn_mbc_to_code P_ | ( | (OnigEncoding enc, const UChar *p, const UChar *end) | ) |
| ONIG_EXTERN int onigenc_mbn_mbc_case_fold P_ | ( | (OnigEncoding enc, OnigCaseFoldType flag, const UChar **p, const UChar *end, UChar *lower) | ) |
| ONIG_EXTERN int onigenc_mb2_code_to_mbclen P_ | ( | (OnigCodePoint code, OnigEncoding enc) | ) |
| ONIG_EXTERN int onigenc_mb2_code_to_mbc P_ | ( | (OnigEncoding enc, OnigCodePoint code, UChar *buf) | ) |
| ONIG_EXTERN int onigenc_minimum_property_name_to_ctype P_ | ( | (OnigEncoding enc, UChar *p, UChar *end) | ) |
| ONIG_EXTERN int onigenc_unicode_property_name_to_ctype P_ | ( | (OnigEncoding enc, UChar *p, UChar *end) | ) |
| ONIG_EXTERN int onigenc_mb2_is_code_ctype P_ | ( | (OnigEncoding enc, OnigCodePoint code, unsigned int ctype) | ) |
| ONIG_EXTERN int onigenc_mb4_code_to_mbclen P_ | ( | (OnigCodePoint code, OnigEncoding enc) | ) |
| ONIG_EXTERN int onigenc_mb4_code_to_mbc P_ | ( | (OnigEncoding enc, OnigCodePoint code, UChar *buf) | ) |
| ONIG_EXTERN int onigenc_mb4_is_code_ctype P_ | ( | (OnigEncoding enc, OnigCodePoint code, unsigned int ctype) | ) |
| ONIG_EXTERN int onigenc_unicode_is_code_ctype P_ | ( | (OnigCodePoint code, unsigned int ctype, OnigEncoding enc) | ) |
| ONIG_EXTERN int onigenc_utf16_32_get_ctype_code_range P_ | ( | (OnigCtype ctype, OnigCodePoint *sb_out, const OnigCodePoint *ranges[], OnigEncoding enc) | ) |
| ONIG_EXTERN int onigenc_unicode_ctype_code_range P_ | ( | (int ctype, const OnigCodePoint *ranges[]) | ) |
| ONIG_EXTERN int onigenc_unicode_get_case_fold_codes_by_str P_ | ( | (OnigEncoding enc, OnigCaseFoldType flag, const OnigUChar *p, const OnigUChar *end, OnigCaseFoldCodeItem items[]) | ) |
| ONIG_EXTERN int onigenc_unicode_mbc_case_fold P_ | ( | (OnigEncoding enc, OnigCaseFoldType flag, const UChar **pp, const UChar *end, UChar *fold) | ) |
| ONIG_EXTERN int onigenc_unicode_apply_all_case_fold P_ | ( | (OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void *arg, OnigEncoding enc) | ) |
| ONIG_EXTERN int onigenc_with_ascii_strncmp P_ | ( | (OnigEncoding enc, const UChar *p, const UChar *end, const UChar *sascii, int n) | ) |
| ONIG_EXTERN int onigenc_with_ascii_strnicmp P_ | ( | (OnigEncoding enc, const UChar *p, const UChar *end, const UChar *sascii, int n) | ) |
| ONIG_EXTERN UChar* onigenc_step P_ | ( | (OnigEncoding enc, const UChar *p, const UChar *end, int n) | ) |
| int onig_is_in_code_range P_ | ( | (const UChar *p, OnigCodePoint code) | ) |
| ONIG_EXTERN int onigenc_mbclen_approximate P_ | ( | (const OnigUChar *p, const OnigUChar *e, struct OnigEncodingTypeST *enc) | ) |
| ONIG_EXTERN OnigUChar* onigenc_step_back P_ | ( | (OnigEncoding enc, const OnigUChar *start, const OnigUChar *s, const OnigUChar *end, int n) | ) |
| ONIG_EXTERN int onigenc_init P_ | ( | (void) | ) |
| ONIG_EXTERN int onigenc_set_default_encoding P_ | ( | (OnigEncoding enc) | ) |
| ONIG_EXTERN void onigenc_set_default_caseconv_table P_ | ( | (const OnigUChar *table) | ) |
| ONIG_EXTERN OnigUChar* onigenc_get_right_adjust_char_head_with_prev P_ | ( | (OnigEncoding enc, const OnigUChar *start, const OnigUChar *s, const OnigUChar *end, const OnigUChar **prev) | ) |
| ONIG_EXTERN OnigUChar* onigenc_get_prev_char_head P_ | ( | (OnigEncoding enc, const OnigUChar *start, const OnigUChar *s, const OnigUChar *end) | ) |
| ONIG_EXTERN int onigenc_strlen P_ | ( | (OnigEncoding enc, const OnigUChar *p, const OnigUChar *end) | ) |
| ONIG_EXTERN int onigenc_strlen_null P_ | ( | (OnigEncoding enc, const OnigUChar *p) | ) |
| void onig_null_warn P_ | ( | (const char *s) | ) |
| ONIG_EXTERN void onig_set_warn_func P_ | ( | (OnigWarnFunc f) | ) |
| ONIG_EXTERN int onig_new P_ | ( | (OnigRegex *, const OnigUChar *pattern, const OnigUChar *pattern_end, OnigOptionType option, OnigEncoding enc, const OnigSyntaxType *syntax, OnigErrorInfo *einfo) | ) |
| ONIG_EXTERN int onig_reg_init P_ | ( | (OnigRegex reg, OnigOptionType option, OnigCaseFoldType case_fold_flag, OnigEncoding enc, const OnigSyntaxType *syntax) | ) |
| ONIG_EXTERN int onig_new_without_alloc P_ | ( | (OnigRegex, const OnigUChar *pattern, const OnigUChar *pattern_end, OnigOptionType option, OnigEncoding enc, OnigSyntaxType *syntax, OnigErrorInfo *einfo) | ) |
| ONIG_EXTERN int onig_new_deluxe P_ | ( | (OnigRegex *reg, const OnigUChar *pattern, const OnigUChar *pattern_end, OnigCompileInfo *ci, OnigErrorInfo *einfo) | ) |
| ONIG_EXTERN void onig_free P_ | ( | (OnigRegex) | ) |
| ONIG_EXTERN int onig_recompile_deluxe P_ | ( | (OnigRegex reg, const OnigUChar *pattern, const OnigUChar *pattern_end, OnigCompileInfo *ci, OnigErrorInfo *einfo) | ) |
| ONIG_EXTERN OnigPosition onig_search P_ | ( | (OnigRegex, const OnigUChar *str, const OnigUChar *end, const OnigUChar *start, const OnigUChar *range, OnigRegion *region, OnigOptionType option) | ) |
| ONIG_EXTERN OnigPosition onig_search_gpos P_ | ( | (OnigRegex, const OnigUChar *str, const OnigUChar *end, const OnigUChar *global_pos, const OnigUChar *start, const OnigUChar *range, OnigRegion *region, OnigOptionType option) | ) |
| ONIG_EXTERN OnigPosition onig_match P_ | ( | (OnigRegex, const OnigUChar *str, const OnigUChar *end, const OnigUChar *at, OnigRegion *region, OnigOptionType option) | ) |
| ONIG_EXTERN void onig_region_init P_ | ( | (OnigRegion *region) | ) |
| ONIG_EXTERN void onig_region_free P_ | ( | (OnigRegion *region, int free_self) | ) |
| ONIG_EXTERN void onig_region_copy P_ | ( | (OnigRegion *to, OnigRegion *from) | ) |
| ONIG_EXTERN int onig_region_resize P_ | ( | (OnigRegion *region, int n) | ) |
| ONIG_EXTERN int onig_region_set P_ | ( | (OnigRegion *region, int at, int beg, int end) | ) |
| ONIG_EXTERN int onig_name_to_group_numbers P_ | ( | (OnigRegex reg, const OnigUChar *name, const OnigUChar *name_end, int **nums) | ) |
| ONIG_EXTERN int onig_name_to_backref_number P_ | ( | (OnigRegex reg, const OnigUChar *name, const OnigUChar *name_end, OnigRegion *region) | ) |
| ONIG_EXTERN int onig_foreach_name P_ | ( | (OnigRegex reg, int(*func)(const OnigUChar *, const OnigUChar *, int, int *, OnigRegex, void *), void *arg) | ) |
| ONIG_EXTERN int onig_number_of_names P_ | ( | (OnigRegex reg) | ) |
| ONIG_EXTERN int onig_capture_tree_traverse P_ | ( | (OnigRegion *region, int at, int(*callback_func)(int, OnigPosition, OnigPosition, int, int, void *), void *arg) | ) |
| ONIG_EXTERN int onig_set_default_syntax P_ | ( | (const OnigSyntaxType *syntax) | ) |
| ONIG_EXTERN void onig_copy_syntax P_ | ( | (OnigSyntaxType *to, const OnigSyntaxType *from) | ) |
| ONIG_EXTERN unsigned int onig_get_syntax_op P_ | ( | (OnigSyntaxType *syntax) | ) |
| ONIG_EXTERN void onig_set_syntax_op P_ | ( | (OnigSyntaxType *syntax, unsigned int op) | ) |
| ONIG_EXTERN void onig_set_syntax_op2 P_ | ( | (OnigSyntaxType *syntax, unsigned int op2) | ) |
| ONIG_EXTERN void onig_set_syntax_behavior P_ | ( | (OnigSyntaxType *syntax, unsigned int behavior) | ) |
| ONIG_EXTERN void onig_set_syntax_options P_ | ( | (OnigSyntaxType *syntax, OnigOptionType options) | ) |
| ONIG_EXTERN int onig_set_meta_char P_ | ( | (OnigSyntaxType *syntax, unsigned int what, OnigCodePoint code) | ) |
| ONIG_EXTERN void onig_copy_encoding P_ | ( | (OnigEncoding to, OnigEncoding from) | ) |
| ONIG_EXTERN int onig_set_default_case_fold_flag P_ | ( | (OnigCaseFoldType case_fold_flag) | ) |
| ONIG_EXTERN int onig_set_match_stack_limit_size P_ | ( | (unsigned int size) | ) |
|
static |
| PRINTF_ARGS | ( | VALUE | rb_enc_sprintfrb_encoding *, const char *,..., |
| 2 | , | ||
| 3 | |||
| ) |
| PRINTF_ARGS | ( | NORETURN(void rb_enc_raise(rb_encoding *, VALUE, const char *,...)) | , |
| 3 | , | ||
| 4 | |||
| ) |
| PRINTF_ARGS | ( | NORETURN(void rb_loaderror(const char *,...)) | , |
| 1 | , | ||
| 2 | |||
| ) |
| PRINTF_ARGS | ( | NORETURN(void rb_loaderror_with_path(VALUE path, const char *,...)) | , |
| 2 | , | ||
| 3 | |||
| ) |
| PRINTF_ARGS | ( | NORETURN(void rb_name_error(ID, const char *,...)) | , |
| 2 | , | ||
| 3 | |||
| ) |
| PRINTF_ARGS | ( | NORETURN(void rb_name_error_str(VALUE, const char *,...)) | , |
| 2 | , | ||
| 3 | |||
| ) |
| PRINTF_ARGS | ( | void | rb_compile_errorconst char *, int, const char *,..., |
| 3 | , | ||
| 4 | |||
| ) |
| PRINTF_ARGS | ( | void | rb_compile_error_with_encconst char *, int, void *, const char *,..., |
| 4 | , | ||
| 5 | |||
| ) |
| PRINTF_ARGS | ( | void | rb_compile_error_appendconst char *,..., |
| 1 | , | ||
| 2 | |||
| ) |
| PRINTF_ARGS | ( | void | ruby_debug_printfconst char *,..., |
| 1 | , | ||
| 2 | |||
| ) |
| PRINTF_ARGS | ( | VALUE | rb_sprintfconst char *,..., |
| 1 | , | ||
| 2 | |||
| ) |
| PRINTF_ARGS | ( | VALUE | rb_str_catfVALUE, const char *,..., |
| 2 | , | ||
| 3 | |||
| ) |
| PRINTF_ARGS | ( | void | rb_warningconst char *,..., |
| 1 | , | ||
| 2 | |||
| ) |
| PRINTF_ARGS | ( | void | rb_compile_warningconst char *, int, const char *,..., |
| 3 | , | ||
| 4 | |||
| ) |
| PRINTF_ARGS | ( | int | ruby_snprintfchar *str, size_t n, char const *fmt,..., |
| 3 | , | ||
| 4 | |||
| ) |
| ONIG_EXTERN int onig_error_code_to_str PV_ | ( | (OnigUChar *s, OnigPosition err_code,...) | ) |
| size_t rb_absint_numwords | ( | VALUE | val, |
| size_t | word_numbits, | ||
| size_t * | nlz_bits_ret | ||
| ) |
Definition at line 3364 of file bignum.c.
References absint_numwords_generic(), absint_numwords_small(), assert, CHAR_BIT, rb_absint_size(), and SIZE_MAX.
Referenced by big2str_base_poweroftwo(), limited_big_rand(), math_log(), math_log10(), math_log2(), rand_init(), rb_big_pow(), and rb_str_format().
| int rb_absint_singlebit_p | ( | VALUE | val | ) |
Definition at line 3428 of file bignum.c.
References BDIGIT, bdigit_roomof, BDIGITS, BIGDN, BIGLO, dp, FIX2LONG, FIXNUM_P, numberof, POW2_P, rb_to_int(), and RBIGNUM_LEN.
Referenced by rb_big_bit_length(), and rb_str_format().
| size_t rb_absint_size | ( | VALUE | val, |
| int * | nlz_bits_ret | ||
| ) |
Definition at line 3231 of file bignum.c.
References BDIGIT, bdigit_roomof, BDIGITS, BIGDN, BIGLO, CHAR_BIT, dp, FIX2LONG, FIXNUM_P, nlz(), numberof, rb_to_int(), RBIGNUM_LEN, and SIZEOF_BDIGITS.
Referenced by rb_absint_numwords(), rb_big_bit_length(), rb_num_to_uint(), and v2w().
| void rb_add_event_hook | ( | rb_event_hook_func_t | func, |
| rb_event_flag_t | events, | ||
| VALUE | data | ||
| ) |
Definition at line 145 of file vm_trace.c.
References alloc_event_hook(), connect_event_hook(), GET_VM, and RUBY_EVENT_HOOK_FLAG_SAFE.
Definition at line 1243 of file vm_method.c.
References rb_method_entry_struct::def, cache_entry::defined_class, rb_method_entry_struct::flag, method_entry_set(), NIL_P, NOEX_UNDEF, rb_method_definition_struct::original_id, rb_cObject, rb_eTypeError, rb_frozen_class_p(), rb_print_undef(), rb_raise(), RB_TYPE_P, RBASIC_CLASS, RCLASS_ORIGIN, RCLASS_SUPER, search_method(), T_ICLASS, T_MODULE, rb_method_definition_struct::type, UNDEFINED_METHOD_ENTRY_P, and VM_METHOD_TYPE_ZSUPER.
Definition at line 869 of file variable.c.
References ALLOC, global_variable::block_trace, global_variable::counter, global_entry, trace_var::next, rb_eRuntimeError, rb_global_entry(), rb_raise(), st_add_direct(), st_data_t, st_lookup(), global_variable::trace, and xfree.
| void* rb_alloc_tmp_buffer | ( | volatile VALUE * | store, |
| long | len | ||
| ) |
Definition at line 925 of file string.c.
References rb_str_tmp_new(), and RSTRING_PTR.
Definition at line 453 of file object.c.
References CLASS_OF, OBJ_INFECT, PRIsVALUE, rb_class_name(), and rb_sprintf().
Calls a method.
| recv | receiver of the method |
| mid | an ID that represents the name of the method |
| args | an Array object which contains method arguments |
Definition at line 746 of file vm_eval.c.
References ALLOCA_N, argc, argv, CALL_FCALL, MEMCPY, OBJ_FREEZE, RARRAY_CONST_PTR, RARRAY_LENINT, RARRAY_PTR, rb_ary_subseq(), rb_call(), RB_GC_GUARD, and RBASIC_CLEAR_CLASS.
Definition at line 3015 of file object.c.
References NIL_P, rb_ary_new3, rb_check_array_type(), rb_check_convert_type(), and T_ARRAY.
Definition at line 1234 of file array.c.
References arg, FIX2LONG, FIXNUM_P, NULL, NUM2LONG, Qfalse, Qnil, RARRAY_LEN, rb_ary_entry(), rb_ary_subseq(), rb_range_beg_len(), and rb_scan_args().
Referenced by Init_Array(), and match_aref().
Definition at line 3636 of file array.c.
References NIL_P, Qnil, RARRAY_AREF, RARRAY_LEN, rb_check_array_type(), and rb_equal().
Referenced by Init_Array().
Definition at line 907 of file array.c.
References ary_ensure_room_for_push(), ary_memcpy(), ARY_SET_LEN, and RARRAY_LEN.
Referenced by enumerator_each(), features_index_add_single(), flatten_i(), generator_each(), lazy_init_iterator(), and rb_ary_push_m().
Definition at line 3380 of file array.c.
References ary_sort_data::ary, ARY_CAPA, ARY_DEFAULT_SIZE, ARY_EMBED_P, ary_resize_capa(), ARY_SET_LEN, ARY_SHARED_P, FL_SET_EMBED, rb_ary_modify_check(), and rb_ary_unshare().
Referenced by coverage_result_i(), fdbm_delete_if(), fgdbm_delete_if(), Init_Array(), iseq_set_arguments(), method_missing(), open_key_args(), r_object0(), rb_io_s_popen(), rb_queue_clear(), rb_szqueue_clear(), rb_threadptr_pending_interrupt_clear(), ruby_set_argv(), set_argv(), and wakeup_all_threads().
Definition at line 3876 of file array.c.
References INT2FIX, NIL_P, Qnil, Qundef, RARRAY_LEN, rb_check_array_type(), rb_exec_recursive_paired(), and recursive_cmp().
Referenced by Init_Array().
Definition at line 3541 of file array.c.
References RARRAY_LEN, rb_ary_modify_check(), rb_ary_splice(), and to_ary().
Referenced by argf_readlines(), enum_sort_by(), flat_map_i(), hash2kv(), hash2kv_enc(), Init_Array(), iseq_set_arguments(), ole_methods(), open_key_args(), rb_str_associate(), and sort_by_i().
Definition at line 2897 of file array.c.
References ary_resize_smaller(), Qnil, RARRAY_AREF, RARRAY_LEN, rb_ary_store(), rb_block_given_p(), rb_equal(), and rb_yield().
Referenced by delete_current_thread(), env_replace_i(), Init_Array(), and queue_delete_from_waiting().
Definition at line 2950 of file array.c.
References ARY_INCREASE_LEN, MEMMOVE, Qnil, RARRAY_AREF, RARRAY_LEN, RARRAY_PTR_USE, and rb_ary_modify().
Referenced by ary_reject_bang(), ole_delete_event(), rb_ary_delete_at_m(), rb_ary_slice_bang(), and rb_threadptr_pending_interrupt_deque().
Definition at line 2927 of file array.c.
References ary_resize_smaller(), RARRAY_AREF, RARRAY_LEN, and rb_ary_store().
Definition at line 1887 of file array.c.
References ary_memcpy(), ARY_SET_LEN, RARRAY_CONST_PTR, RARRAY_LEN, and rb_ary_new2.
Referenced by ary2sv(), coverage_result_i(), each_cons_i(), enumerator_each(), enumerator_peek_values_m(), iseq_build_from_ary_body(), method_def_location(), opobj_inspect(), rb_ary_compact(), rb_ary_sample(), rb_ary_shuffle(), rb_ary_sort(), rb_ary_transpose(), rb_ary_uniq(), rb_io_s_popen(), rb_struct_s_members_m(), save_env_i(), and thread_create_core().
Definition at line 1777 of file array.c.
References ary_enum_length(), RARRAY_AREF, RARRAY_LEN, rb_yield(), and RETURN_SIZED_ENUMERATOR.
Referenced by dir_s_glob(), Init_Array(), and ossl_asn1cons_each().
Definition at line 1171 of file array.c.
References RARRAY_LEN, and rb_ary_elt().
Referenced by addrinfo_initialize(), addrinfo_ip_address(), addrinfo_ip_unpack(), addrinfo_mload(), ary2ptr_dispparams(), ary_len_of_dim(), ary_new_dim(), check_exec_redirect(), check_type_val2variant(), collect_caller_bindings(), dimension(), divmodv(), enc_register_at(), EVENTSINK_Invoke(), evs_entry(), foletypelib_initialize(), folevariant_initialize(), folevariant_s_array(), frame_get(), generate_json_array(), generate_json_object(), get_loaded_features_index(), hash2named_arg(), initialize_params(), iseq_build_from_ary_body(), iseq_data_to_ary(), iseq_load(), JSON_parse_string(), lazy_zip_arrays_func(), lep_svar_get(), match_i(), ole_ary_m_entry(), ole_invoke(), ole_invoke2(), ole_search_event(), ole_search_event_at(), oletypelib_search_registry2(), ossl_asn1cons_to_der(), ossl_call_client_cert_cb(), ossl_call_session_get_cb(), ossl_call_session_new_cb(), ossl_call_session_remove_cb(), ossl_sslctx_set_ciphers(), ossl_x509name_init_i(), parse_main(), path_split(), pty_close_pty(), rb_ary_aref(), rb_ary_at(), rb_ary_bsearch(), rb_ary_product(), rb_ary_values_at(), rb_debug_inspector_frame_binding_get(), rb_debug_inspector_frame_class_get(), rb_debug_inspector_frame_iseq_get(), rb_debug_inspector_frame_self_get(), rb_econv_init_by_convpath(), rb_enc_aliases_enc_i(), rb_enc_from_encoding_index(), rb_execarg_addopt(), rb_iseq_build_from_ary(), rb_iseq_disasm(), rb_reg_s_union(), rb_reg_s_union_m(), rb_struct_each_pair(), rb_struct_to_h(), reduce0(), rescue_callback(), select_internal(), set_state_ivars(), start_document(), time_timespec(), and wdivmod().
| void rb_ary_free | ( | VALUE | ) |
Definition at line 540 of file array.c.
References ARY_HEAP_PTR, ARY_HEAP_SIZE, ARY_OWNS_HEAP_P, and ruby_sized_xfree().
Referenced by ary_discard(), loaded_features_index_clear_i(), obj_free(), rb_ary_decrement_share(), and ruby_vm_run_at_exit_hooks().
Definition at line 397 of file array.c.
References rb_obj_freeze().
Referenced by coverage_result_i(), curry(), make_curry_proc(), and rb_add_method().
Definition at line 3817 of file array.c.
References Qfalse, Qtrue, RARRAY_AREF, RARRAY_LEN, and rb_equal().
Referenced by env_replace_i(), and Init_Array().
Definition at line 1994 of file array.c.
References ary_join_0(), ary_join_1(), FALSE, NIL_P, OBJ_TAINT, OBJ_TAINTED, RARRAY_AREF, RARRAY_LEN, rb_check_string_type(), rb_enc_associate(), rb_str_buf_new(), rb_usascii_encoding(), rb_usascii_str_new(), result, RSTRING_LEN, StringValue, TRUE, and val.
Referenced by keyword_error(), pipe_open(), rb_ary_join_m(), rb_ary_times(), rb_insn_operand_intern(), rb_spawn_process(), and tcl_protect_core().
Definition at line 1329 of file array.c.
References ary_take_first_or_last(), ARY_TAKE_LAST, Qnil, RARRAY_AREF, and RARRAY_LEN.
Referenced by Init_Array(), and range_last().
| void rb_ary_modify | ( | VALUE | ) |
Definition at line 314 of file array.c.
References ALLOC_N, ARY_EMBED_PTR, ARY_HEAP_PTR, ARY_SET_CAPA, ARY_SET_EMBED_LEN, ARY_SET_PTR, ARY_SHARED, ARY_SHARED_OCCUPIED, ARY_SHARED_P, FL_SET_EMBED, FL_UNSET_SHARED, MEMCPY, MEMMOVE, OBJ_PROMOTED, RARRAY_CONST_PTR, RARRAY_EMBED_LEN_MAX, RARRAY_LEN, RARRAY_PTR_USE, rb_ary_decrement_share(), rb_ary_modify_check(), rb_ary_unshare(), rb_gc_writebarrier_remember_promoted(), and shift().
Referenced by ary_ensure_room_for_push(), ary_ensure_room_for_unshift(), ary_resize_smaller(), rb_ary_collect_bang(), rb_ary_compact_bang(), rb_ary_delete_at(), rb_ary_fill(), rb_ary_initialize(), rb_ary_resize(), rb_ary_reverse(), rb_ary_rotate(), rb_ary_select_bang(), rb_ary_shuffle_bang(), rb_ary_sort_bang(), rb_ary_sort_by_bang(), rb_ary_splice(), and rb_ary_store().
| VALUE rb_ary_new | ( | void | ) |
Definition at line 495 of file array.c.
References RARRAY_EMBED_LEN_MAX, and rb_ary_new2.
Referenced by add_event_call_back(), add_modules(), addrinfo_list_new(), argf_readlines(), ary_new_dim(), backtrace_collect(), cbsubst_get_extra_args_tbl(), cbsubst_table_setup(), check_exec_redirect1(), class_instance_method_list(), collect_caller_bindings(), collect_values_of_values(), debug_lines(), dir_globs(), econv_convpath(), enum_collect(), enum_cycle(), enum_drop(), enum_drop_while(), enum_find_all(), enum_flat_map(), enum_grep(), enum_partition(), enum_reject(), enum_sort_by(), enum_take_while(), enum_to_a(), enum_zip(), env_each_pair(), env_keys(), env_to_a(), env_values(), env_values_at(), EVENTSINK_Invoke(), fdbm_keys(), fdbm_select(), fdbm_to_a(), fdbm_values(), fev_initialize(), fgdbm_keys(), fgdbm_select(), fgdbm_to_a(), fgdbm_values(), filename_completion_proc_call(), foletype_s_progids(), foletypelib_ole_types(), foletypelib_s_typelibs(), fsdbm_delete_if(), fsdbm_keys(), fsdbm_select(), fsdbm_to_a(), fsdbm_values(), gc_profile_record_get(), Init_GC(), Init_load(), Init_ossl_asn1(), Init_VM(), Init_win32ole(), int_ossl_asn1_decode0_cons(), iseq_data_to_ary(), JSON_parse_array(), lep_svar_set(), make_addrinfo(), make_hostent_internal(), nsdr(), ole_method_params(), ole_method_return_type_detail(), ole_methods(), ole_methods_from_typeinfo(), ole_param_ole_type_detail(), ole_type_impl_ole_types(), ole_variable_ole_type_detail(), ole_variables(), ole_variant2val(), ossl_asn1_decode0(), ossl_asn1_decode_all(), ossl_get_errors(), ossl_pkcs7_get_recipient(), ossl_pkcs7_get_signer(), ossl_sslctx_get_ciphers(), ossl_x509_get_extensions(), ossl_x509crl_get_extensions(), ossl_x509crl_get_revoked(), ossl_x509name_to_a(), ossl_x509req_get_attributes(), ossl_x509revoked_get_extensions(), ossl_x509stctx_get_chain(), pack_unpack(), parse(), prepare_iseq_build(), proc_curry(), proc_waitall(), rb_ary_and(), rb_ary_diff(), rb_ary_drop(), rb_ary_reject(), rb_call_end_proc(), rb_check_exec_env(), rb_enc_aliases(), rb_execarg_addopt(), rb_f_global_variables(), rb_f_local_variables(), rb_f_untrace_var(), rb_fiddle_ptr_free_get(), rb_gzreader_readlines(), rb_insn_operand_intern(), rb_insns_name_array(), rb_io_readlines(), rb_iseq_disasm(), rb_iseq_line_trace_all(), rb_mod_ancestors(), rb_mod_included_modules(), rb_mod_nesting(), rb_obj_instance_variables(), rb_obj_singleton_methods(), rb_push_glob(), rb_reg_names(), rb_scan_args(), rb_str_enumerate_bytes(), rb_str_enumerate_lines(), rb_str_scan(), rb_str_split_m(), rb_struct_select(), rb_thread_keys(), rb_thread_list(), rb_thread_variables(), reachable_objects_from(), reduce0(), save_env(), save_redirect_fd(), search_convpath_i(), select_internal(), sock_s_gethostbyaddr(), strio_readlines(), thgroup_list(), tk_hash_kv(), username_completion_proc_call(), vm_backtrace_to_ary(), vm_expandarray(), vm_yield_setup_block_args(), wmap_keys(), and wmap_values().
| VALUE rb_ary_new_capa | ( | long | capa | ) |
Definition at line 489 of file array.c.
References ary_new(), and rb_cArray.
Referenced by rb_ary_sample(), rb_ary_zip(), rb_hash_flatten(), rb_hash_keys(), rb_hash_to_a(), rb_hash_values(), rb_str_enumerate_chars(), and rb_str_enumerate_codepoints().
| VALUE rb_ary_new_from_args | ( | long | n, |
| ... | |||
| ) |
Definition at line 501 of file array.c.
References ARY_SET_LEN, RARRAY_ASET, and rb_ary_new2.
Referenced by rb_ary_sample().
Definition at line 520 of file array.c.
References ary_memcpy(), ARY_SET_LEN, and rb_ary_new2.
Referenced by lazy_zip_func(), and rb_ary_sample().
Definition at line 3509 of file array.c.
References ary_memcpy(), ARY_SET_LEN, RARRAY_CONST_PTR, RARRAY_LEN, rb_ary_new2, and to_ary().
Referenced by assoc2kv(), assoc2kv_enc(), curry(), Init_Array(), and tk_conv_args().
Definition at line 940 of file array.c.
References ARY_CAPA, ARY_DEFAULT_SIZE, ARY_OWNS_HEAP_P, ary_resize_capa(), ARY_SET_LEN, Qnil, RARRAY_AREF, RARRAY_LEN, and rb_ary_modify_check().
Referenced by cut_stack_tail(), flatten(), lib_eventloop_ensure(), r_object0(), rb_ary_pop_m(), rb_str_split_m(), rb_thread_s_handle_interrupt(), rb_uninterruptible(), and ruby_vm_run_at_exit_hooks().
Definition at line 896 of file array.c.
References ary_ensure_room_for_push(), ARY_SET_LEN, RARRAY_ASET, and RARRAY_LEN.
Referenced by add_event_call_back(), add_modules(), addrinfo_list_new(), ary2list(), ary2list2(), ary_reject(), assoc2kv(), assoc2kv_enc(), backtrace_collect(), BigDecimal_split(), callback(), cbsubst_scan_args(), cdhash_each(), check_exec_env_i(), check_exec_redirect1(), chunk_ii(), collect_all(), collect_caller_bindings_cfunc(), collect_caller_bindings_iseq(), collect_i(), collect_local_variables_in_iseq(), collect_trace(), collect_values(), compile_array_(), cv_list_i(), cycle_i(), define_final0(), drop_i(), drop_while_i(), each_cons_i(), each_slice_i(), econv_convpath(), enc_names_i(), env_each_pair(), env_keys(), env_to_a(), env_values(), env_values_at(), EVENTSINK_Invoke(), evs_push(), fdbm_delete_if(), fdbm_keys(), fdbm_select(), fdbm_to_a(), fdbm_values(), fdbm_values_at(), features_index_add_single(), fgdbm_delete_if(), fgdbm_keys(), fgdbm_select(), fgdbm_to_a(), fgdbm_values(), fgdbm_values_at(), filename_completion_proc_call(), find_all_i(), first_i(), flat_map_i(), flatten(), foletype_s_progids(), foletypelib_s_typelibs(), fsdbm_delete_if(), fsdbm_keys(), fsdbm_select(), fsdbm_to_a(), fsdbm_values(), fsdbm_values_at(), gc_profile_record_get(), generator_each(), grep_i(), grep_iter_i(), group_by_i(), gvar_i(), Init_Array(), Init_Encoding(), Init_ossl_ssl(), Init_VM(), ins_methods_push(), int_ossl_asn1_decode0_cons(), ip_ruby_cmd(), iseq_add_mark_object_compile_time(), iseq_data_to_ary(), iseq_set_arguments(), ivar_i(), JSON_parse_array(), JSON_parse_string(), keys_i(), lazy_init_iterator(), lazy_zip(), lazy_zip_arrays_func(), lazy_zip_func(), lex_getline(), lib_eventloop_launcher(), lib_split_tklist_core(), list_i(), make_addrinfo(), make_hostent_internal(), match_array(), match_i(), mk_ary_of_str(), nsdr(), ole_method_params(), ole_methods_sub(), ole_type_impl_ole_types(), ole_typedesc2val(), ole_types_from_typelib(), ole_usertype2val(), ole_variables(), open_key_args(), ossl_asn1_decode0(), ossl_asn1_decode_all(), ossl_get_errors(), ossl_pkcs7_get_recipient(), ossl_pkcs7_get_signer(), ossl_ssl_cipher_to_ary(), ossl_ssl_get_peer_cert_chain(), ossl_sslctx_get_ciphers(), ossl_sslctx_session_get_cb(), ossl_sslctx_session_new_cb(), ossl_sslctx_session_remove_cb(), ossl_x509_get_extensions(), ossl_x509crl_get_extensions(), ossl_x509crl_get_revoked(), ossl_x509name_to_a(), ossl_x509req_get_attributes(), ossl_x509revoked_get_extensions(), ossl_x509stctx_get_chain(), parse(), partition_i(), proc_waitall(), push_include(), push_kv(), push_kv_enc(), push_pattern(), push_value(), queue_do_pop(), queue_do_push(), r_object0(), random_dump(), rb_ary_and(), rb_ary_collect(), rb_ary_diff(), rb_ary_product(), rb_ary_select(), rb_ary_zip(), rb_condvar_wait(), rb_construct_expanded_load_path(), rb_enc_name_list_i(), rb_execarg_addopt(), rb_f_global_variables(), rb_f_local_variables(), rb_f_untrace_var(), rb_fiddle_ptr_free_get(), rb_gc_register_mark_object(), rb_get_kwargs(), rb_get_values_at(), rb_gzreader_readlines(), rb_hash_values_at(), rb_insn_operand_intern(), rb_insns_name_array(), rb_io_readlines(), rb_iseq_add_mark_object(), rb_iseq_parameters(), rb_local_constants_i(), rb_mod_ancestors(), rb_mod_included_modules(), rb_mod_nesting(), rb_provide_feature(), rb_require_safe(), rb_str_enumerate_bytes(), rb_str_enumerate_chars(), rb_str_enumerate_codepoints(), rb_str_enumerate_lines(), rb_str_scan(), rb_str_split_m(), rb_struct_define(), rb_struct_define_under(), rb_struct_define_without_accessor(), rb_struct_define_without_accessor_under(), rb_struct_select(), rb_szqueue_push(), rb_thread_s_handle_interrupt(), rb_threadptr_pending_interrupt_enque(), rb_uninterruptible(), rb_zlib_crc_table(), reachable_object_from_i(), reg_names_iter(), reject_i(), ruby_init_loadpath_safe(), ruby_set_argv(), ruby_vm_at_exit(), save_env_i(), save_redirect_fd(), scan_once(), select_internal(), set_argv(), slicebefore_ii(), sock_s_gethostbyaddr(), strio_readlines(), symbols_i(), take_i(), take_while_i(), thgroup_list_i(), thread_keys_i(), thread_list_i(), tk_conv_args(), to_a_i(), unnamed_parameters(), username_completion_proc_call(), values_i(), waitall_each(), wmap_keys_i(), wmap_values_i(), yycompile0(), yyparse(), zip_ary(), and zip_i().
Definition at line 3669 of file array.c.
References Qnil, RARRAY_AREF, RARRAY_LEN, rb_equal(), RB_TYPE_P, and T_ARRAY.
Referenced by Init_Array().
Definition at line 3330 of file array.c.
References ARY_HEAP_SIZE, ary_make_shared(), ary_memcpy(), ARY_OWNS_HEAP_P, ARY_SET_LEN, ARY_SET_PTR, ARY_SHARED, ARY_SHARED_P, FL_SET_EMBED, FL_UNSET_EMBED, FL_UNSET_SHARED, RARRAY_CONST_PTR, RARRAY_EMBED_LEN_MAX, RARRAY_LEN, RARRAY_PTR_USE, rb_ary_decrement_share(), rb_ary_modify_check(), rb_ary_set_shared(), rb_ary_unshare_safe(), ruby_sized_xfree(), and to_ary().
Referenced by enc_list(), Init_Array(), rb_ary_flatten_bang(), rb_ary_initialize(), rb_ary_sort_by_bang(), rb_ary_to_a(), rb_construct_expanded_load_path(), and reset_loaded_features_snapshot().
expands or shrinks ary to len elements.
expanded region will be filled with Qnil.
| ary | an array |
| len | new size |
Definition at line 1614 of file array.c.
References ARY_CAPA, ARY_DEFAULT_SIZE, ary_discard(), ary_double_capa(), ARY_EMBED_P, ARY_EMBED_PTR, ARY_HEAP_PTR, ARY_MAX_SIZE, ary_mem_clear(), ARY_SET_CAPA, ARY_SET_EMBED_LEN, ARY_SET_HEAP_LEN, ARY_SET_LEN, MEMCPY, RARRAY, RARRAY_EMBED_LEN_MAX, RARRAY_LEN, rb_ary_modify(), rb_eIndexError, rb_raise(), and SIZED_REALLOC_N.
Referenced by enum_sort_by(), and rb_get_values_at().
Definition at line 1897 of file array.c.
References RARRAY_CONST_PTR, RARRAY_LEN, and rb_ary_new4.
Referenced by obj_resurrect().
Definition at line 2175 of file array.c.
References ary_reverse(), RARRAY_LEN, RARRAY_PTR_USE, and rb_ary_modify().
Referenced by collect_caller_bindings(), and rb_ary_reverse_bang().
Definition at line 2239 of file array.c.
References ary_reverse(), Qnil, RARRAY_LEN, RARRAY_PTR, rb_ary_modify(), and rotate_count().
Referenced by rb_ary_rotate_bang().
| void rb_ary_set_len | ( | VALUE | , |
| long | |||
| ) |
Definition at line 1591 of file array.c.
References ARY_CAPA, ARY_SET_LEN, ARY_SHARED_P, rb_ary_modify_check(), rb_bug(), rb_eRuntimeError, and rb_raise().
Referenced by method_missing(), rb_hash_keys(), rb_hash_values(), and rb_struct_s_def().
Definition at line 425 of file array.c.
References ARY_EMBED_P, ARY_SHARED_P, Qfalse, Qtrue, and RARRAY.
Referenced by get_loaded_features_index(), and rb_get_expanded_load_path().
Definition at line 991 of file array.c.
References ARY_DEFAULT_SIZE, ARY_EMBED_P, ARY_INCREASE_LEN, ARY_INCREASE_PTR, ary_make_shared(), ARY_SHARED, ARY_SHARED_OCCUPIED, ARY_SHARED_P, assert, MEMMOVE, Qnil, RARRAY_AREF, RARRAY_ASET, RARRAY_LEN, RARRAY_PTR_USE, rb_ary_modify_check(), and top.
Referenced by argf_next_argv(), each_cons_i(), filename_completion_proc_call(), process_sflag(), queue_do_pop(), rb_ary_shift_m(), rb_szqueue_max_set(), rb_threadptr_pending_interrupt_deque(), require_libraries(), username_completion_proc_call(), and wakeup_first_thread().
Definition at line 2506 of file array.c.
References ary_sort_data::ary, rb_ary_dup(), and rb_ary_sort_bang().
Referenced by enum_sort(), and Init_Array().
Definition at line 2424 of file array.c.
References ary_sort_data::ary, ARY_EMBED_LEN, ARY_EMBED_P, ARY_EMBED_PTR, ARY_HEAP_PTR, ARY_HEAP_SIZE, ary_make_substitution(), ary_memcpy(), ARY_SET_CAPA, ARY_SET_EMBED_LEN, ARY_SET_HEAP_LEN, ARY_SET_LEN, ARY_SET_PTR, ARY_SHARED_P, assert, FL_FREEZE, FL_SET, FL_SET_EMBED, FL_UNSET, FL_UNSET_EMBED, FL_UNSET_SHARED, ary_sort_data::opt_inited, ary_sort_data::opt_methods, RARRAY_CONST_PTR, RARRAY_LEN, RARRAY_PTR_USE, rb_ary_modify(), rb_ary_unshare(), rb_block_given_p(), rb_cArray, RBASIC_CLEAR_CLASS, RBASIC_SET_CLASS_RAW, ruby_qsort(), ruby_sized_xfree(), sort_1(), and sort_2().
Referenced by Init_Array(), and rb_ary_sort().
Definition at line 790 of file array.c.
References ARY_CAPA, ary_double_capa(), ARY_MAX_SIZE, ary_mem_clear(), ARY_SET_LEN, RARRAY_ASET, RARRAY_LEN, rb_ary_modify(), rb_eIndexError, and rb_raise().
Referenced by addrinfo_ip_unpack(), ary_new_dim(), ary_store_dim(), check_exec_fds(), collect_caller_bindings(), collect_caller_bindings_cfunc(), collect_caller_bindings_iseq(), decorate_convpath(), econv_primitive_errinfo(), enc_register_at(), enum_minmax(), enum_sort_by(), evs_delete(), get_loaded_features_index(), Init_ossl_asn1(), iseq_build_from_ary_body(), iseq_data_to_ary(), lep_svar_set(), ossl_generate_cb(), path_entries(), path_s_glob(), pty_getpty(), rb_ary_aset(), rb_ary_collect_bang(), rb_ary_delete(), rb_ary_delete_same(), rb_ary_initialize(), rb_ary_select_bang(), rb_ary_transpose(), rb_enc_aliases_enc_i(), reg_named_captures_iter(), search_convpath_i(), sym_to_proc(), unnamed_parameters(), zip_ary(), and zip_i().
Definition at line 1180 of file array.c.
References ary_make_partial(), ary_new(), Qnil, RARRAY_LEN, and rb_obj_class().
Referenced by get_stack_tail(), rb_apply(), rb_ary_aref(), rb_ary_drop(), rb_ary_take(), and take_items().
| VALUE rb_ary_tmp_new | ( | long | ) |
Definition at line 534 of file array.c.
References ary_new().
Referenced by ary_buf_new(), callback(), compile_array_(), cont_capture(), enum_sort_by(), fdbm_delete_if(), fgdbm_delete_if(), Init_load(), Init_Thread(), Init_top_self(), iseq_set_arguments(), lazy_init_iterator(), method_missing(), open_key_args(), prepare_iseq_build(), r_object0(), rb_construct_expanded_load_path(), rb_get_kwargs(), rb_iseq_add_mark_object(), rb_struct_define(), rb_struct_define_under(), rb_struct_define_without_accessor(), rb_struct_define_without_accessor_under(), rb_struct_new(), rb_struct_s_def(), sym_to_proc(), and thread_create_core().
Definition at line 1522 of file array.c.
References NIL_P, rb_ary_new3, and rb_check_array_type().
Referenced by rb_ary_splice(), and vm_expandarray().
Definition at line 2095 of file array.c.
References rb_ary_inspect().
Definition at line 1153 of file array.c.
References rb_ary_unshift_m().
Referenced by check_funcall_exec(), ole_invoke(), parser_set_encode(), and vm_call0_body().
| int rb_ascii8bit_encindex | ( | void | ) |
Definition at line 1236 of file encoding.c.
References rb_ascii8bit_encindex.
| rb_encoding* rb_ascii8bit_encoding | ( | void | ) |
Definition at line 1227 of file encoding.c.
References enc_table, and rb_enc_init().
Referenced by do_opendir(), do_writeconv(), file_path_convert(), get_actual_encoding(), int_chr(), io_ascii8bit_binmode(), load_file_internal(), make_writeconv(), parser_str_new(), rb_define_dummy_encoding(), rb_encdb_dummy(), rb_external_str_with_enc(), rb_file_open_internal(), rb_glob(), rb_gzreader_ungetc(), rb_gzwriter_write(), rb_io_ext_int_to_encs(), rb_io_extract_modeenc(), rb_reg_initialize(), rb_reg_initialize_m(), rb_reg_initialize_str(), rb_reg_new(), rb_reg_prepare_enc(), rb_reg_preprocess_dregexp(), rb_reg_s_union(), rb_str_concat(), rb_str_conv_enc_opts(), rb_str_dump(), rb_str_encode_ospath(), rb_strftime_with_timespec(), rb_symname_p(), rb_w32_readdir(), reg_fragment_setenc_gen(), ruby_brace_glob(), ruby_glob(), ruby_init_loadpath_safe(), strio_read(), strio_ungetc(), and strio_write().
Definition at line 616 of file array.c.
References rb_ary_new3.
Referenced by addrinfo_getnameinfo(), addrinfo_mdump(), assoc_i(), BigDecimal_coerce(), BigDecimal_divmod(), BigDecimal_prec(), check_exec_env_i(), check_exec_redirect1(), chunk_i(), chunk_ii(), dump_output(), each_pair_i(), econv_convpath(), enum_minmax_by(), enum_partition(), env_assoc(), env_each_pair(), env_rassoc(), env_shift(), env_to_a(), fdbm_delete_if(), fdbm_each_pair(), fdbm_select(), fdbm_shift(), fdbm_to_a(), fgdbm_delete_if(), fgdbm_each_pair(), fgdbm_select(), fgdbm_shift(), fgdbm_to_a(), fix_divmod(), flo_coerce(), flo_divmod(), fsdbm_delete_if(), fsdbm_each_pair(), fsdbm_select(), fsdbm_shift(), fsdbm_to_a(), match_offset(), math_frexp(), math_lgamma(), nucomp_coerce(), nucomp_marshal_dump(), nucomp_polar(), nucomp_rect(), num_coerce(), num_divmod(), numeric_polar(), numeric_rect(), nurat_coerce(), nurat_marshal_dump(), ossl_bn_coerce(), proc_wait2(), proc_waitall(), pty_open(), rassoc_i(), rb_big_coerce(), rb_big_divmod(), rb_big_divrem_normal(), rb_file_s_split(), rb_gcdlcm(), rb_hash_assoc(), rb_hash_shift(), rb_io_s_pipe(), rb_struct_each_pair(), rsock_s_recvfrom(), rsock_s_recvfrom_nonblock(), save_redirect_fd(), search_convpath_i(), sock_accept(), sock_accept_nonblock(), sock_s_getnameinfo(), sock_s_unpack_sockaddr_in(), sock_sysaccept(), sockopt_linger(), to_a_i(), waitall_each(), and yyparse().
Definition at line 859 of file vm_method.c.
References NIL_P, NOEX_MODFUNC, NOEX_PRIVATE, NOEX_PROTECTED, NOEX_PUBLIC, PRIsVALUE, rb_add_method(), rb_check_attr_id(), rb_eArgError, rb_id2str(), rb_id_attrset(), rb_intern_str, rb_raise(), rb_sprintf(), rb_warning(), SCOPE_CHECK, SCOPE_TEST, VM_METHOD_TYPE_ATTRSET, and VM_METHOD_TYPE_IVAR.
Definition at line 1127 of file variable.c.
References Qnil, and rb_ivar_lookup().
Definition at line 1607 of file variable.c.
References ALLOC, autoload, check_autoload_table, DATA_PTR, autoload_data_i::feature, FL_TAINT, FL_UNSET, OBJ_FREEZE, PRIsVALUE, Qnil, Qundef, QUOTE_ID, rb_const_set(), rb_eArgError, rb_eNameError, rb_is_const_id(), RB_OBJ_WRITTEN, rb_raise(), rb_safe_level, rb_str_new2, RCLASS_CONST_TBL, RCLASS_IV_TBL, autoload_data_i::safe_level, st_add_direct(), st_data_t, st_init_numtable(), st_insert(), st_lookup(), autoload_data_i::thread, TypedData_Wrap_Struct, and autoload_data_i::value.
Definition at line 1769 of file variable.c.
References autoload_const_set(), autoload_defined_p(), autoload_require(), check_autoload_data, check_autoload_required(), id, autoload_const_set_args::id, mod, autoload_const_set_args::mod, Qfalse, Qnil, Qundef, rb_ensure(), RB_GC_GUARD, rb_jump_tag(), rb_protect(), rb_safe_level, rb_set_safe_level_force(), rb_sourcefile, rb_thread_current(), reset_safe(), result, RTEST, autoload_data_i::thread, and autoload_const_set_args::value.
Definition at line 1814 of file variable.c.
References autoload_defined_p(), check_autoload_data, check_autoload_required(), autoload_data_i::feature, Qnil, and RCLASS_SUPER.
|
static |
| VALUE rb_backref_get | ( | void | ) |
Definition at line 912 of file vm.c.
References vm_svar_get().
| void rb_backref_set | ( | VALUE | ) |
Definition at line 918 of file vm.c.
References vm_svar_set().
| void rb_backtrace | ( | void | ) |
Definition at line 782 of file vm_backtrace.c.
References vm_backtrace_print().
| int rb_backtrace_p | ( | VALUE | obj | ) |
Definition at line 417 of file vm_backtrace.c.
References rb_typeddata_is_kind_of().
| void rb_backtrace_print_as_bugreport | ( | void | ) |
Definition at line 766 of file vm_backtrace.c.
References backtrace_each(), oldbt_arg::data, oldbt_arg::func, GET_THREAD(), oldbt_bugreport(), oldbt_init(), oldbt_iter_cfunc(), and oldbt_iter_iseq().
| void rb_backtrace_print_to | ( | VALUE | output | ) |
Definition at line 803 of file vm_backtrace.c.
References backtrace_each(), oldbt_arg::data, oldbt_arg::func, GET_THREAD(), oldbt_init(), oldbt_iter_cfunc(), oldbt_iter_iseq(), and oldbt_print_to().
Definition at line 637 of file vm_backtrace.c.
References backtrace_to_location_ary(), GetCoreDataFromValue, and rb_backtrace_struct::locary.
Definition at line 590 of file vm_backtrace.c.
References rb_backtrace_struct::backtrace_size, backtrace_to_str_ary(), bt_iter_arg::bt, GetCoreDataFromValue, and rb_backtrace_struct::strary.
| double rb_big2dbl | ( | VALUE | ) |
Definition at line 5267 of file bignum.c.
References big2dbl(), isinf(), and rb_warning().
Referenced by flo_div(), flo_divmod(), flo_minus(), flo_mod(), flo_mul(), flo_plus(), flo_pow(), ole_val2ptr_variant(), ole_val2variant(), rb_big_divide(), rb_big_fdiv(), rb_big_minus(), rb_big_mul(), rb_big_plus(), rb_big_pow(), rb_big_to_f(), and rb_Float().
| SIGNED_VALUE rb_big2long | ( | VALUE | ) |
Definition at line 5099 of file bignum.c.
References big2ulong(), LONG_MAX, LONG_MIN, rb_eRangeError, rb_raise(), and RBIGNUM_POSITIVE_P.
Referenced by rb_num2long().
Definition at line 5012 of file bignum.c.
References rb_big2str1().
Referenced by GetVpValueWithPrec(), rb_big_to_s(), and rb_str_format().
Definition at line 4890 of file bignum.c.
References big2str_generic().
Definition at line 4807 of file bignum.c.
References big2str_base_poweroftwo().
Definition at line 5082 of file bignum.c.
References big2ulong(), LONG_MAX, LONG_MIN, rb_eRangeError, rb_raise(), and RBIGNUM_POSITIVE_P.
Referenced by rb_num2ulong_internal(), and rb_num_to_uint().
| void rb_big_2comp | ( | VALUE | ) |
Definition at line 3033 of file bignum.c.
References get2comp().
Definition at line 6477 of file bignum.c.
References abs2twocomp(), BDIGIT, BDIGITS, bigand_int(), bignew, bignorm(), FIX2LONG, FIXNUM_P, RB_BIGNUM_TYPE_P, RB_GC_GUARD, rb_num_coerce_bit(), and twocomp2abs_bang().
Referenced by fix_and(), and Init_Bignum().
Definition at line 3004 of file bignum.c.
References BDIGIT, BDIGITS, bignew_1(), CLASS_OF, MEMCPY, RBIGNUM_LEN, and RBIGNUM_SIGN.
Referenced by rb_big_abs(), rb_big_neg(), and rb_big_uminus().
Definition at line 5391 of file bignum.c.
References bary_cmp(), BDIGITS, cmp, FIX2LONG, FIXNUM_P, INT2FIX, RB_BIGNUM_TYPE_P, RB_FLOAT_TYPE_P, rb_int2big(), rb_integer_float_cmp(), rb_intern, rb_num_coerce_cmp(), RBIGNUM_LEN, and RBIGNUM_SIGN.
Referenced by big_op(), fix_cmp(), fix_ge(), fix_gt(), fix_le(), fix_lt(), Init_Bignum(), and rb_integer_float_cmp().
Definition at line 6159 of file bignum.c.
References rb_big_divide().
Referenced by fix_divide(), and Init_Bignum().
Definition at line 6235 of file bignum.c.
References bigdivmod(), bignorm(), div, FIX2LONG, FIXNUM_P, mod, rb_assoc_new(), RB_BIGNUM_TYPE_P, rb_int2big(), rb_intern, and rb_num_coerce_bin().
Referenced by fix_divmod(), and Init_Bignum().
Definition at line 2698 of file bignum.c.
References bary_divmod_normal(), BARY_TRUNC, BDIGIT, BDIGITS, BIGDIVREM_EXTRA_WORDS, bignew, bigtrunc(), LONG2FIX, rb_assoc_new(), RB_GC_GUARD, rb_num_zerodiv(), RBIGNUM_LEN, RBIGNUM_SIGN, and big_div_struct::yn.
Definition at line 5527 of file bignum.c.
References BDIGIT, BDIGITS, bignorm(), FIX2LONG, FIXNUM_P, MEMCMP, Qfalse, Qtrue, RB_BIGNUM_TYPE_P, rb_equal(), RB_FLOAT_TYPE_P, rb_int2big(), rb_integer_float_eq(), RBIGNUM_LEN, and RBIGNUM_SIGN.
Referenced by fix_equal(), Init_Bignum(), and rb_integer_float_eq().
Definition at line 5559 of file bignum.c.
References BDIGIT, BDIGITS, MEMCMP, Qfalse, Qtrue, RB_BIGNUM_TYPE_P, RBIGNUM_LEN, and RBIGNUM_SIGN.
Referenced by Init_Bignum().
Definition at line 6319 of file bignum.c.
References big2dbl(), big_fdiv_float(), big_fdiv_int(), DBL2NUM, FIX2LONG, FIXNUM_P, isinf(), isnan, rb_big2dbl(), RB_BIGNUM_TYPE_P, RB_FLOAT_TYPE_P, rb_int2big(), rb_intern, rb_num_coerce_bin(), and RFLOAT_VALUE.
Referenced by fix_fdiv(), and Init_Bignum().
Definition at line 6172 of file bignum.c.
References rb_big_divide(), and rb_intern.
Referenced by Init_Bignum().
Definition at line 6758 of file bignum.c.
References big_shift2(), big_shift3(), bignorm(), bit_length, BITSPERDIG, FIX2LONG, FIXNUM_P, RB_BIGNUM_TYPE_P, rb_to_int(), and shift().
Referenced by fix_lshift(), Init_Bignum(), and rb_fix_lshift().
Definition at line 5901 of file bignum.c.
References bigadd(), bigadd_int(), bignorm(), bigsub_int(), DBL2NUM, FIX2LONG, FIXNUM_P, rb_big2dbl(), RB_BIGNUM_TYPE_P, RB_FLOAT_TYPE_P, rb_num_coerce_bin(), RBIGNUM_SIGN, and RFLOAT_VALUE.
Referenced by fix_minus(), Init_Bignum(), rand_int(), rand_range(), rb_int_pred(), sub(), and wsub().
Definition at line 6187 of file bignum.c.
References bigdivmod(), bignorm(), FIX2LONG, FIXNUM_P, RB_BIGNUM_TYPE_P, rb_int2big(), and rb_num_coerce_bin().
Referenced by fix_mod(), Init_Bignum(), and mod().
Definition at line 5995 of file bignum.c.
References bigmul0(), bignorm(), DBL2NUM, FIX2LONG, FIXNUM_P, rb_big2dbl(), RB_BIGNUM_TYPE_P, RB_FLOAT_TYPE_P, rb_int2big(), rb_num_coerce_bin(), and RFLOAT_VALUE.
Referenced by f_imul(), fix_mul(), Init_Bignum(), int_pair_to_real_inclusive(), int_pow(), mul(), and wmul().
Definition at line 1668 of file bignum.c.
References bary_mul_balance_with_mulfunc(), BDIGITS, bignew, NULL, RB_GC_GUARD, RBIGNUM_LEN, and RBIGNUM_SIGN.
Definition at line 1849 of file bignum.c.
References bary_mul_karatsuba(), BDIGITS, bignew, KARATSUBA_BALANCED, NULL, rb_eArgError, RB_GC_GUARD, rb_raise(), RBIGNUM_LEN, and RBIGNUM_SIGN.
Definition at line 1540 of file bignum.c.
References bary_mul_normal(), BDIGITS, bignew, RB_GC_GUARD, RBIGNUM_LEN, and RBIGNUM_SIGN.
Definition at line 2246 of file bignum.c.
References bary_mul_toom3(), BDIGITS, bignew, NULL, rb_eArgError, RB_GC_GUARD, rb_raise(), RBIGNUM_LEN, RBIGNUM_SIGN, and TOOM3_BALANCED.
Definition at line 3136 of file bignum.c.
References bignorm().
Referenced by fix_aref(), and rand_range().
Definition at line 6603 of file bignum.c.
References abs2twocomp(), BDIGIT, BDIGITS, bignew, bignorm(), bigor_int(), FIX2LONG, FIXNUM_P, RB_BIGNUM_TYPE_P, RB_GC_GUARD, rb_num_coerce_bit(), and twocomp2abs_bang().
Referenced by fix_or(), and Init_Bignum().
| void rb_big_pack | ( | VALUE | val, |
| unsigned long * | buf, | ||
| long | num_longs | ||
| ) |
Definition at line 3199 of file bignum.c.
References INTEGER_PACK_2COMP, INTEGER_PACK_LSWORD_FIRST, INTEGER_PACK_NATIVE_BYTE_ORDER, and rb_integer_pack().
Referenced by is_even(), and rb_dlcfunc_call().
Definition at line 5865 of file bignum.c.
References bigadd(), bigadd_int(), bignorm(), bigsub_int(), DBL2NUM, FIX2LONG, FIXNUM_P, rb_big2dbl(), RB_BIGNUM_TYPE_P, RB_FLOAT_TYPE_P, rb_num_coerce_bin(), RBIGNUM_SIGN, and RFLOAT_VALUE.
Referenced by add(), fix_plus(), Init_Bignum(), rand_range(), rb_int_succ(), rb_random_int32(), ulong_to_num_plus_1(), and wadd().
Definition at line 6361 of file bignum.c.
References bigmul0(), bignorm(), bigsq(), bigtrunc(), BIGZEROP, DBL2NUM, FIX2LONG, FIXNUM_MAX, FIXNUM_P, INT2FIX, NULL, rb_absint_numwords(), rb_big2dbl(), RB_BIGNUM_TYPE_P, rb_complex_raw1, RB_FLOAT_TYPE_P, rb_funcall(), rb_intern, rb_num_coerce_bin(), rb_rational_raw1, rb_warn(), RBIGNUM_SIGN, RFLOAT_VALUE, round(), and SIGNED_VALUE.
Referenced by fix_pow(), Init_Bignum(), and int_pow().
| void rb_big_resize | ( | VALUE | big, |
| long | len | ||
| ) |
Definition at line 2973 of file bignum.c.
References rb_big_realloc(), and RBIGNUM_SET_LEN.
Referenced by big_extend_carry(), bigfixize(), and bigtrunc().
Definition at line 6796 of file bignum.c.
References big_shift2(), big_shift3(), bignorm(), bit_length, BITSPERDIG, FIX2LONG, FIXNUM_P, RB_BIGNUM_TYPE_P, rb_to_int(), and shift().
Referenced by Init_Bignum(), math_log(), math_log10(), math_log2(), and rb_fix_rshift().
Definition at line 1609 of file bignum.c.
References bary_sq_fast(), BDIGITS, bignew, RB_GC_GUARD, and RBIGNUM_LEN.
Definition at line 5576 of file bignum.c.
References bignorm(), rb_big_clone(), RBIGNUM_SET_SIGN, and RBIGNUM_SIGN.
Referenced by Init_Bignum(), and rand_int().
| VALUE rb_big_unpack | ( | unsigned long * | buf, |
| long | num_longs | ||
| ) |
Definition at line 3207 of file bignum.c.
References INTEGER_PACK_2COMP, INTEGER_PACK_LSWORD_FIRST, INTEGER_PACK_NATIVE_BYTE_ORDER, and rb_integer_unpack().
Definition at line 6703 of file bignum.c.
References abs2twocomp(), BDIGIT, BDIGITS, bignew, bignorm(), bigxor_int(), FIX2LONG, FIXNUM_P, RB_BIGNUM_TYPE_P, RB_GC_GUARD, rb_num_coerce_bit(), and twocomp2abs_bang().
Referenced by fix_xor(), and Init_Bignum().
| int rb_bigzero_p | ( | VALUE | x | ) |
Definition at line 2903 of file bignum.c.
References BIGZEROP.
Referenced by rand_int(), and rand_range().
| VALUE rb_binding_new | ( | void | ) |
Definition at line 347 of file proc.c.
References rb_thread_struct::cfp, GET_THREAD(), and rb_binding_new_with_cfp().
| int rb_block_arity | ( | void | ) |
Definition at line 881 of file proc.c.
References rb_thread_struct::cfp, GET_THREAD(), GetProcPtr, rb_proc_t::is_lambda, max(), rb_block_struct::proc, rb_block_min_max_arity(), rb_eArgError, rb_raise(), rb_vm_control_frame_block_ptr(), and UNLIMITED_ARGUMENTS.
| int rb_block_given_p | ( | void | ) |
Definition at line 712 of file eval.c.
References rb_thread_struct::cfp, FALSE, GET_THREAD(), rb_vm_control_frame_block_ptr(), and TRUE.
Referenced by argf_bytes(), argf_chars(), argf_codepoints(), argf_lines(), dh_generate(), dir_s_chdir(), dir_s_glob(), dir_s_open(), dsa_generate(), enum_chunk(), enum_count(), enum_find_index(), enum_grep(), enum_inject(), enum_max(), enum_min(), enum_minmax(), enum_slice_before(), enum_zip(), enumerator_each(), enumerator_initialize(), env_delete_m(), env_fetch(), env_update_i(), etc_group(), etc_passwd(), fdbm_delete(), fdbm_fetch(), fdbm_fetch_m(), fdbm_s_open(), fgdbm_fetch(), fgdbm_fetch_m(), fgdbm_s_open(), fsdbm_delete(), fsdbm_fetch(), fsdbm_fetch_m(), fsdbm_s_open(), generator_initialize(), gzfile_wrap(), lazy_drop_while(), lazy_flat_map(), lazy_grep(), lazy_initialize(), lazy_map(), lazy_reject(), lazy_select(), lazy_take_while(), lazy_to_enum(), lazy_zip(), mSyslog_open(), obj_to_enum(), ossl_pem_passwd_cb(), ossl_x509store_verify(), p_gid_switch(), p_uid_switch(), pack_unpack(), path_each_line(), path_open(), path_s_glob(), path_sub(), proc_call(), pty_getpty(), pty_open(), range_max(), range_min(), rb_ary_count(), rb_ary_delete(), rb_ary_fetch(), rb_ary_fill(), rb_ary_index(), rb_ary_initialize(), rb_ary_product(), rb_ary_rindex(), rb_ary_sort_bang(), rb_ary_uniq(), rb_ary_uniq_bang(), rb_ary_zip(), rb_dlhandle_initialize(), rb_f_at_exit(), rb_f_open(), rb_fiddle_handle_initialize(), rb_gzreader_bytes(), rb_gzreader_lines(), rb_hash_delete(), rb_hash_fetch_m(), rb_hash_initialize(), rb_hash_update(), rb_io_bytes(), rb_io_chars(), rb_io_codepoints(), rb_io_lines(), rb_io_s_new(), rb_io_s_open(), rb_io_s_pipe(), rb_io_s_popen(), rb_iterator_p(), rb_method_call(), rb_mod_initialize(), rb_mutex_synchronize_m(), rb_need_block(), rb_reg_match_m(), rb_scan_args(), rb_str_enumerate_bytes(), rb_str_enumerate_chars(), rb_str_enumerate_codepoints(), rb_str_enumerate_lines(), rb_str_match_m(), rb_str_scan(), rb_str_scrub(), rb_str_sub_bang(), rb_struct_s_def(), rb_thread_s_handle_interrupt(), rsa_generate(), specific_eval(), strio_bytes(), strio_chars(), strio_codepoints(), strio_lines(), strio_s_open(), thread_initialize(), tk_s_new(), tracepoint_disable_m(), tracepoint_enable_m(), tracepoint_new_s(), zstream_detach_buffer(), zstream_expand_buffer(), and zstream_run().
| VALUE rb_block_lambda | ( | void | ) |
Definition at line 655 of file proc.c.
References proc_new(), rb_cProc, and TRUE.
| VALUE rb_block_proc | ( | void | ) |
Definition at line 641 of file proc.c.
References FALSE, proc_new(), and rb_cProc.
| int rb_bug_reporter_add | ( | void(*)(FILE *, void *) | func, |
| void * | data | ||
| ) |
Definition at line 282 of file error.c.
References bug_reporters_size, bug_reporters::data, func, bug_reporters::func, and MAX_BUG_REPORTERS.
Referenced by trace_object_allocations_debug_start().
Definition at line 451 of file error.c.
References FIXNUM_P, NIL_P, rb_obj_classname(), RB_TYPE_P, SYMBOL_P, T_FALSE, and T_TRUE.
Referenced by enum_to_h_i(), rb_ary_to_h(), and rb_hash_s_create().
| const char* rb_builtin_type_name | ( | int | t | ) |
Definition at line 440 of file error.c.
References name, and numberof.
Referenced by rb_check_type(), and w_object().
| void rb_call_end_proc | ( | VALUE | data | ) |
Definition at line 11 of file eval_jump.c.
References rb_ary_new(), and rb_proc_call().
Referenced by m_core_set_postexe(), and rb_f_at_exit().
| void rb_call_inits | ( | void | ) |
Definition at line 274 of file vm_eval.c.
References GET_THREAD(), PASS_PASSED_BLOCK, and vm_call_super().
| VALUE rb_catch_protect | ( | VALUE | t, |
| rb_block_call_func * | func, | ||
| VALUE | data, | ||
| int * | stateptr | ||
| ) |
Definition at line 1834 of file vm_eval.c.
References rb_thread_struct::cfp, rb_thread_struct::errinfo, GET_THREAD(), Qnil, rb_vm_rewind_cfp(), rb_vm_tag::retval, RNODE, rb_vm_tag::tag, rb_thread_struct::tag, TAG_THROW, TH_EXEC_TAG, TH_POP_TAG, and TH_PUSH_TAG.
| int rb_char_to_option_kcode | ( | int | c, |
| int * | option, | ||
| int * | kcode | ||
| ) |
Definition at line 301 of file re.c.
References ARG_ENCODING_FIXED, ARG_ENCODING_NONE, char_to_option(), rb_ascii8bit_encindex, and rb_utf8_encindex.
|
inlinestatic |
Definition at line 298 of file intern.h.
References rb_check_arity, rb_error_arity(), and UNLIMITED_ARGUMENTS.
Definition at line 628 of file array.c.
References rb_check_convert_type(), and T_ARRAY.
Referenced by addrinfo_initialize(), dir_s_glob(), divmodv(), econv_init(), enum_to_h_i(), enum_zip(), flat_map_i(), flatten(), io_puts_ary(), lazy_flat_map_to_ary(), lazy_zip(), ossl_x509name_initialize(), path_split(), rb_Array(), rb_ary_assoc(), rb_ary_cmp(), rb_ary_initialize(), rb_ary_s_try_convert(), rb_ary_to_ary(), rb_ary_to_h(), rb_check_argv(), rb_econv_init_by_convpath(), rb_execarg_addopt(), rb_hash_s_create(), rb_io_s_popen(), rb_reg_s_union_m(), rb_str_format_m(), rb_yield_splat(), sock_s_getnameinfo(), take_items(), time_timespec(), vm_yield_setup_block_args(), and wdivmod().
Definition at line 769 of file error.c.
References err, NIL_P, RARRAY_AREF, RARRAY_LEN, rb_ary_new3, rb_backtrace_p(), rb_raise(), RB_TYPE_P, T_ARRAY, and T_STRING.
Referenced by exc_set_backtrace(), and get_backtrace().
Definition at line 2632 of file object.c.
References convert_type(), FALSE, NIL_P, Qnil, rb_eTypeError, rb_obj_classname(), rb_raise(), T_DATA, and TYPE.
Definition at line 2098 of file error.c.
References FL_ABLE, FL_TAINT, PRIsVALUE, rb_check_frozen_internal, rb_raise(), rb_safe_level, and RBASIC.
Referenced by random_init(), and random_load().
| void rb_check_frozen | ( | VALUE | ) |
Definition at line 2081 of file error.c.
References rb_check_frozen, and rb_check_frozen_internal.
|
inlinestatic |
Definition at line 273 of file intern.h.
References rb_check_frozen_internal.
Definition at line 409 of file vm_eval.c.
References check_funcall_callable(), check_funcall_missing(), check_funcall_respond_to(), CLASS_OF, GET_THREAD(), NOEX_OK, Qundef, rb_search_method_entry(), stack_check(), and vm_call0().
| VALUE rb_check_funcall_with_hook | ( | VALUE | recv, |
| ID | mid, | ||
| int | argc, | ||
| const VALUE * | argv, | ||
| rb_check_funcall_hook * | hook, | ||
| VALUE | arg | ||
| ) |
Definition at line 428 of file vm_eval.c.
References arg, argc, argv, check_funcall_callable(), check_funcall_missing(), check_funcall_respond_to(), CLASS_OF, FALSE, GET_THREAD(), NOEX_OK, Qundef, rb_search_method_entry(), rescue_funcall_args::recv, stack_check(), TRUE, and vm_call0().
Definition at line 588 of file hash.c.
References rb_check_convert_type(), and T_HASH.
Returns ID for the given name if it is interned already, or 0.
| namep | the pointer to the name object |
namep must be a Symbol or a String, or possible to convert with to_str method. namep is a Symbol or a String if non-zero value is returned, or is a String if 0 is returned. Definition at line 17321 of file ripper.c.
References global_symbols, id, name, NIL_P, OBJ_FREEZE, rb_check_string_type(), rb_enc_copy(), rb_eTypeError, RB_GC_GUARD, rb_id_attrset(), rb_inspect(), rb_is_attrset_name(), rb_raise(), RB_TYPE_P, RSTRING_LEN, RSTRING_PTR, setup_fake_str(), st_data_t, st_lookup(), SYM2ID, sym_check_asciionly(), symbols::sym_id, SYMBOL_P, and T_STRING.
Referenced by check_definition(), check_local_id(), enum_inject(), obj_respond_to(), rb_f_untrace_var(), rb_mod_alias_method(), rb_mod_autoload_p(), rb_mod_cvar_defined(), rb_mod_cvar_get(), rb_mod_instance_method(), rb_mod_method_defined(), rb_mod_public_instance_method(), rb_mod_remove_const(), rb_mod_remove_cvar(), rb_mod_remove_method(), rb_mod_undef_method(), rb_obj_ivar_defined(), rb_obj_ivar_get(), rb_obj_method(), rb_obj_public_method(), rb_obj_remove_instance_variable(), rb_obj_singleton_method(), rb_struct_aref(), rb_struct_aset(), rb_thread_aref(), rb_thread_key_p(), rb_thread_variable_get(), rb_thread_variable_p(), send_internal(), set_const_visibility(), set_method_visibility(), and vm_call_opt_send().
| ID rb_check_id_cstr | ( | const char * | ptr, |
| long | len, | ||
| rb_encoding * | enc | ||
| ) |
Definition at line 17363 of file ripper.c.
References RString::as, global_symbols, RString::heap, id, rb_enc_associate(), rb_id_attrset(), rb_is_attrset_name(), setup_fake_str(), st_data_t, st_lookup(), sym_check_asciionly(), and symbols::sym_id.
Referenced by rb_mod_const_defined(), rb_mod_const_get(), rb_path_to_class(), and rb_str_format().
| void rb_check_safe_obj | ( | VALUE | ) |
Definition at line 122 of file safe.c.
References OBJ_TAINTED, rb_insecure_operation(), and rb_safe_level.
Definition at line 1679 of file string.c.
References rb_check_convert_type(), and T_STRING.
Definition at line 2955 of file object.c.
References Qnil, rb_check_convert_type(), rb_cNumeric, rb_obj_is_kind_of(), RB_TYPE_P, and T_FLOAT.
Definition at line 2686 of file object.c.
References rb_check_to_integer().
Definition at line 2666 of file object.c.
References convert_type(), FALSE, FIXNUM_P, Qnil, rb_cInteger, rb_obj_is_kind_of(), RB_TYPE_P, and T_BIGNUM.
| void rb_check_trusted | ( | VALUE | ) |
Definition at line 2093 of file error.c.
References rb_check_trusted.
|
inlinestatic |
Definition at line 279 of file intern.h.
References rb_check_trusted_internal.
| void rb_check_type | ( | VALUE | , |
| int | |||
| ) |
Definition at line 477 of file error.c.
References builtin_class_name, Qundef, rb_bug(), rb_builtin_type_name(), rb_eTypeError, rb_fatal(), rb_raise(), RTYPEDDATA_P, T_DATA, T_MASK, and TYPE.
Referenced by tcl2rb_bool(), tcl2rb_num_or_nil(), tcl2rb_num_or_str(), tcl2rb_string(), and tkstr_to_number().
| void* rb_check_typeddata | ( | VALUE | , |
| const rb_data_type_t * | |||
| ) |
Definition at line 520 of file error.c.
References builtin_class_name, DATA_PTR, rb_eTypeError, rb_obj_classname(), rb_raise(), RB_TYPE_P, rb_typeddata_inherited_p(), RTYPEDDATA_P, RTYPEDDATA_TYPE, T_DATA, and rb_data_type_struct::wrap_struct_name.
Referenced by BigDecimal_initialize(), BigDecimal_initialize_copy(), check_addrinfo(), check_strscan(), dir_check(), dir_open_dir(), and econv_init().
Definition at line 397 of file variable.c.
References NIL_P, NULL, fc_result::path, rb_class_real(), rb_ivar_set(), rb_tmp_class_path(), and RSTRING_PTR.
Definition at line 1565 of file object.c.
References CLASS_OR_MODULE_P, class_search_ancestor(), mod, Qfalse, Qnil, Qtrue, rb_eTypeError, rb_raise(), RB_TYPE_P, RCLASS_ORIGIN, and T_ICLASS.
Definition at line 391 of file variable.c.
References rb_class_path(), and rb_class_real().
Definition at line 1856 of file object.c.
References rb_obj_alloc(), and rb_obj_call_init().
Definition at line 1630 of file ruby.h.
References FIXNUM_P, FLONUM_P, IMMEDIATE_P, Qfalse, Qnil, Qtrue, rb_cFalseClass, rb_cFixnum, rb_cFloat, rb_cNilClass, rb_cSymbol, rb_cTrueClass, RBASIC, RTEST, and SYMBOL_P.
Definition at line 257 of file variable.c.
References NIL_P, fc_result::path, rb_ivar_set(), rb_str_dup(), and rb_tmp_class_path().
Definition at line 281 of file variable.c.
References classpath, Qnil, RCLASS_IV_TBL, st_data_t, st_lookup(), and tmp_classpath.
Definition at line 204 of file object.c.
References BUILTIN_TYPE, FL_SINGLETON, RBASIC, RCLASS_SUPER, and T_ICLASS.
Definition at line 673 of file object.c.
References class_or_module_required(), class_search_ancestor(), and RCLASS_ORIGIN.
Definition at line 1886 of file object.c.
References Qnil, rb_cBasicObject, rb_eTypeError, rb_raise(), RB_TYPE_P, RCLASS_SUPER, and T_ICLASS.
| void rb_clear_cache | ( | void | ) |
Definition at line 52 of file vm_method.c.
References INC_GLOBAL_CONSTANT_STATE, INC_GLOBAL_METHOD_STATE, and rb_warning().
| void rb_clear_constant_cache | ( | void | ) |
Definition at line 60 of file vm_method.c.
References INC_GLOBAL_CONSTANT_STATE.
| void rb_clear_method_cache_by_class | ( | VALUE | ) |
Definition at line 66 of file vm_method.c.
References INC_GLOBAL_METHOD_STATE, Qundef, rb_cBasicObject, rb_class2name(), rb_class_clear_method_cache(), rb_cObject, rb_mKernel, rb_sourcefile, rb_sourceline(), RUBY_DTRACE_METHOD_CACHE_CLEAR, and RUBY_DTRACE_METHOD_CACHE_CLEAR_ENABLED.
| void rb_clear_trace_func | ( | void | ) |
Definition at line 225 of file vm_trace.c.
References clear_trace_func_i(), GET_VM, rb_remove_event_hook(), st_data_t, and st_foreach().
| int rb_cloexec_dup | ( | int | oldfd | ) |
Definition at line 244 of file io.c.
References rb_cloexec_fcntl_dupfd().
| int rb_cloexec_dup2 | ( | int | oldfd, |
| int | newfd | ||
| ) |
| int rb_cloexec_fcntl_dupfd | ( | int | fd, |
| int | minfd | ||
| ) |
Definition at line 323 of file io.c.
References errno, F_DUPFD, fcntl(), rb_cloexec_fcntl_dupfd(), and rb_maygvl_fd_fix_cloexec().
Definition at line 228 of file io.c.
References O_CLOEXEC, and rb_maygvl_fd_fix_cloexec().
| int rb_cloexec_pipe | ( | int | fildes[2] | ) |
Definition at line 286 of file io.c.
References errno, O_CLOEXEC, and rb_maygvl_fd_fix_cloexec().
| void rb_close_before_exec | ( | int | lowfd, |
| int | maxhint, | ||
| VALUE | noclose_fds | ||
| ) |
Definition at line 2909 of file bignum.c.
References BIGZEROP, FIX2LONG, FIXNUM_P, INT2FIX, NIL_P, RB_BIGNUM_TYPE_P, rb_cmperr(), rb_funcall(), RBIGNUM_SIGN, and RTEST.
Referenced by cmp(), cmp_eq(), cmp_ge(), cmp_gt(), cmp_le(), cmp_lt(), enum_each_cons_size(), flo_cmp(), max_by_i(), max_i(), max_ii(), min_by_i(), min_i(), min_ii(), minmax_by_i(), minmax_by_i_update(), minmax_i(), minmax_i_update(), minmax_ii(), minmax_ii_update(), r_le(), r_lt(), range_bsearch(), range_max(), range_min(), rb_ary_bsearch(), rb_invcmp(), ruby_num_interval_step_size(), sort_1(), sort_2(), sort_by_cmp(), and wcmp().
Definition at line 12087 of file ripper.c.
References parser_compile_string(), rb_filesystem_str_new_cstr(), rb_parser_new(), and rb_str_new().
Referenced by rb_load_file().
Definition at line 12107 of file ripper.c.
References rb_parser_compile_file(), and rb_parser_new().
Definition at line 12067 of file ripper.c.
References must_be_ascii_compatible(), parser_compile_string(), rb_filesystem_str_new_cstr(), and rb_parser_new().
Definition at line 1337 of file complex.c.
References nucomp_s_convert(), and rb_cComplex.
Referenced by nurat_coerce().
Definition at line 1323 of file complex.c.
References nucomp_s_canonicalize_internal(), and rb_cComplex.
Referenced by num_imaginary().
Definition at line 1329 of file complex.c.
References f_complex_polar(), and rb_cComplex.
Referenced by read_comp().
Definition at line 1317 of file complex.c.
References nucomp_s_new_internal(), and rb_cComplex.
Referenced by parser_set_number_literal().
Definition at line 2124 of file variable.c.
References FALSE, rb_const_defined_0(), and TRUE.
Definition at line 2130 of file variable.c.
References FALSE, rb_const_defined_0(), and TRUE.
Definition at line 2118 of file variable.c.
References FALSE, rb_const_defined_0(), and TRUE.
Definition at line 1880 of file variable.c.
References FALSE, rb_const_get_0(), and TRUE.
Definition at line 1886 of file variable.c.
References FALSE, rb_const_get_0(), and TRUE.
Definition at line 1874 of file variable.c.
References FALSE, rb_const_get_0(), and TRUE.
| VALUE rb_const_list | ( | void * | ) |
Definition at line 2039 of file variable.c.
References list_i(), st_table::num_entries, rb_ary_new2, st_foreach_safe(), and st_free_table().
Definition at line 1942 of file variable.c.
References autoload_delete(), id, PRIsVALUE, Qnil, Qundef, QUOTE_ID, rb_check_frozen, rb_class_name(), rb_clear_constant_cache(), rb_const_defined_at(), rb_name_error(), RCLASS_CONST_TBL, st_data_t, st_delete(), val, and xfree.
Definition at line 2160 of file variable.c.
References ALLOC, autoload_data(), autoload_delete(), check_autoload_data, check_before_mod_set(), CONST_PUBLIC, rb_const_entry_struct::file, rb_const_entry_struct::flag, rb_const_entry_struct::line, MEMZERO, NIL_P, PRIsVALUE, Qundef, QUOTE_ID, rb_class_name(), rb_clear_constant_cache(), rb_cObject, rb_compile_warn(), rb_eTypeError, RB_OBJ_WRITE, rb_raise(), rb_sourcefilename(), rb_sourceline(), rb_thread_current(), rb_warn(), RCLASS_CONST_TBL, RSTRING_PTR, st_data_t, st_delete(), st_init_numtable(), st_insert(), st_lookup(), autoload_data_i::thread, rb_const_entry_struct::value, autoload_data_i::value, and xfree.
Definition at line 2617 of file object.c.
References convert_type(), rb_eTypeError, rb_obj_classname(), rb_raise(), TRUE, and TYPE.
Definition at line 1049 of file variable.c.
References trace_var::data, FL_EXIVAR, FL_SET, FL_TEST, FL_UNSET, st_table::num_entries, rb_free_generic_ivar(), st_add_direct(), st_copy(), st_data_t, st_free_table(), st_insert(), and st_lookup().
Definition at line 4371 of file bignum.c.
References rb_cstr_to_inum().
Referenced by JSON_parse_integer().
| double rb_cstr_to_dbl | ( | const char * | , |
| int | |||
| ) |
Definition at line 2784 of file object.c.
References bad, buf, DBL_DIG, errno, ISDIGIT, ISSPACE, OutOfRange, rb_eArgError, rb_invalid_str(), rb_raise(), rb_warning(), and strtod.
Definition at line 3961 of file bignum.c.
References bad, bignorm(), bit_length, c, CHAR_BIT, conv_digit, GMP_STR2BIG_DIGITS, INT2FIX, ISSPACE, KARATSUBA_MUL_DIGITS, LONG2FIX, maxpow_in_bdigit_dbl(), POSFIXABLE, POW2_P, rb_eArgError, rb_invalid_str(), rb_raise(), rb_uint2big(), RBIGNUM_SET_SIGN, result, roomof, str2big_karatsuba(), str2big_normal(), str2big_poweroftwo(), str2big_scan_digits(), strlen(), STRTOUL, and val.
Referenced by asn1integer_to_num(), ossl_bn_to_i(), parser_yylex(), rb_cstr2inum(), rb_str_to_inum(), read_digits(), str2num(), and tkstr_to_int().
| VALUE rb_current_realfilepath | ( | void | ) |
Definition at line 1956 of file vm_eval.c.
References rb_iseq_location_struct::absolute_path, rb_thread_struct::cfp, GET_THREAD(), rb_control_frame_struct::iseq, rb_iseq_struct::location, Qnil, RUBY_VM_PREVIOUS_CONTROL_FRAME, and vm_get_ruby_level_caller_cfp().
Definition at line 2426 of file variable.c.
References rb_cvar_get(), rb_intern, rb_is_class_id(), and rb_name_error().
Definition at line 2416 of file variable.c.
References rb_cvar_set(), rb_intern, rb_is_class_id(), and rb_name_error().
Definition at line 2408 of file variable.c.
References CVAR_LOOKUP, Qfalse, and Qtrue.
Definition at line 2381 of file variable.c.
References BUILTIN_TYPE, CVAR_LOOKUP, id, original_module(), PRIsVALUE, QUOTE_ID, rb_class_name(), rb_name_error(), rb_warning(), RCLASS_IV_TBL, RTEST, ruby_verbose, st_data_t, st_delete(), and T_CLASS.
Definition at line 2348 of file variable.c.
References BUILTIN_TYPE, check_before_mod_set(), CVAR_LOOKUP, id, original_module(), PRIsVALUE, QUOTE_ID, rb_class_name(), rb_st_insert_id_and_value(), rb_warning(), RCLASS_IV_TBL, RTEST, ruby_verbose, st_data_t, st_delete(), st_init_numtable(), and T_CLASS.
| VALUE rb_data_object_alloc | ( | VALUE | , |
| void * | , | ||
| RUBY_DATA_FUNC | , | ||
| RUBY_DATA_FUNC | |||
| ) |
Definition at line 1369 of file gc.c.
References Check_Type, newobj_of(), T_CLASS, and T_DATA.
| VALUE rb_data_typed_object_alloc | ( | VALUE | klass, |
| void * | datap, | ||
| const rb_data_type_t * | |||
| ) |
Definition at line 1376 of file gc.c.
References Check_Type, rb_data_type_struct::flags, newobj_of(), T_CLASS, T_DATA, and T_MASK.
| VALUE rb_dbl2big | ( | double | ) |
Definition at line 5211 of file bignum.c.
References bignorm(), and dbl2big().
Referenced by BigDecimal_power(), case_when_optimizable_literal(), dbl2ival(), fix_divide(), flo_ceil(), flo_floor(), flo_truncate(), float_decode_internal(), rb_big_divide(), rb_convert_to_integer(), rb_integer_float_cmp(), rb_integer_float_eq(), rb_str_format(), and ruby_num_interval_step_size().
| VALUE rb_dbl_cmp | ( | double | , |
| double | |||
| ) |
| rb_encoding* rb_default_external_encoding | ( | void | ) |
Definition at line 1351 of file encoding.c.
References default_encoding::enc, default_encoding::index, rb_enc_from_index(), and rb_locale_encoding().
Referenced by argf_external_encoding(), argf_internal_encoding(), gzfile_new(), Init_enc_set_filesystem_encoding(), io_read_encoding(), ole_init_cp(), rb_enc_default_external(), rb_enc_reg_error_desc(), rb_external_str_new(), rb_external_str_new_cstr(), rb_inspect(), rb_io_ext_int_to_encs(), rb_reg_desc(), rb_str_export(), rb_str_inspect(), rb_str_quote_unprintable(), rb_str_symname_p(), require_libraries(), strio_init(), strio_set_encoding(), and validate_enc_binmode().
Definition at line 3018 of file file.c.
References copy_home_path(), getenv, rb_eArgError, and rb_raise().
| rb_encoding* rb_default_internal_encoding | ( | void | ) |
Definition at line 1436 of file encoding.c.
References default_encoding::enc, default_encoding::index, and rb_enc_from_index().
Referenced by file_path_convert(), int_chr(), ole_init_cp(), parse(), process_options(), rb_enc_default_internal(), rb_enc_reg_error_desc(), rb_external_str_with_enc(), rb_io_ext_int_to_encs(), rb_reg_desc(), rb_str_inspect(), rb_str_quote_unprintable(), and rb_str_symname_p().
| void rb_define_alloc_func | ( | VALUE | , |
| rb_alloc_func_t | |||
| ) |
Definition at line 2436 of file variable.c.
References rb_cvar_set(), rb_intern, rb_is_class_id(), and rb_name_error().
Definition at line 2225 of file variable.c.
References rb_const_set(), rb_intern, rb_is_const_id(), and rb_warn().
| int rb_define_dummy_encoding | ( | const char * | ) |
Definition at line 437 of file encoding.c.
References rb_encoding_entry::enc, ENC_SET_DUMMY, enc_table, rb_ascii8bit_encoding(), and rb_enc_replicate().
Referenced by create_dummy_encoding_for_tk_core(), make_dummy_encoding(), ole_cp2encoding(), rb_nkf_enc_get(), and str_transcode0().
Definition at line 1990 of file gc.c.
References define_final0(), should_be_callable(), and should_be_finalizable().
Definition at line 2236 of file variable.c.
References rb_cObject, and rb_define_const().
Definition at line 585 of file variable.c.
References global_variable::data, global_variable::getter, global_id(), gvar_getter_t, gvar_setter_t, global_variable::marker, Qnil, RB_GC_GUARD, rb_global_entry(), global_variable::setter, rb_global_entry::var, var_getter, var_marker, and var_setter.
Definition at line 610 of file variable.c.
References rb_define_hooked_variable(), and readonly_setter.
Definition at line 604 of file variable.c.
References rb_define_hooked_variable().
Definition at line 616 of file variable.c.
References global_variable::getter, rb_define_hooked_variable(), readonly_setter, global_variable::setter, and val_getter.
| VALUE rb_detach_process | ( | rb_pid_t | pid | ) |
Definition at line 1027 of file process.c.
References detach_process_pid(), detach_process_watcher(), id_pid(), PIDT2NUM, rb_define_singleton_method(), rb_thread_create(), and rb_thread_local_aset().
| VALUE rb_dir_getwd | ( | void | ) |
Definition at line 886 of file dir.c.
References my_getcwd, rb_enc_associate(), rb_filesystem_encoding(), rb_tainted_str_new2, and xfree.
Referenced by dir_s_chdir(), dir_s_getwd(), and rb_realpath_internal().
| int rb_during_gc | ( | void | ) |
Definition at line 5198 of file gc.c.
References during_gc, and rb_objspace.
| int rb_dvar_defined | ( | ID | ) |
Definition at line 5898 of file compile.c.
References rb_thread_struct::base_block, GET_THREAD(), rb_block_struct::iseq, rb_iseq_struct::local_table, rb_iseq_struct::local_table_size, rb_iseq_struct::parent_iseq, and rb_iseq_struct::type.
Referenced by dvar_defined_gen().
Definition at line 1175 of file vm_eval.c.
References CALL_FCALL, and rb_call().
| VALUE rb_econv_append | ( | rb_econv_t * | ec, |
| const char * | bytesrc, | ||
| long | bytesize, | ||
| VALUE | dst, | ||
| int | flags | ||
| ) |
Definition at line 1813 of file transcode.c.
References rb_econv_t::destination_encoding, dp, econv_destination_buffer_full, rb_econv_t::last_tc, LONG_MAX, rb_transcoder::max_output, NIL_P, rb_eArgError, rb_econv_check_error(), rb_econv_convert(), rb_enc_associate(), rb_raise(), rb_str_buf_new(), rb_str_capacity(), rb_str_resize(), rb_str_set_len(), RSTRING_LEN, RSTRING_PTR, and rb_transcoding::transcoder.
Definition at line 1786 of file transcode.c.
References asciicompat_encoding_t::ascii_compat_name, asciicompat_encoding_t::ascii_incompat_name, asciicompat_encoding_i(), NULL, st_table::num_entries, st_data_t, st_foreach(), and st_lookup().
| void rb_econv_binmode | ( | rb_econv_t * | ec | ) |
Definition at line 1942 of file transcode.c.
References ECONV_CR_NEWLINE_DECORATOR, ECONV_CRLF_NEWLINE_DECORATOR, ECONV_NEWLINE_DECORATOR_MASK, ECONV_UNIVERSAL_NEWLINE_DECORATOR, rb_econv_t::elems, rb_econv_t::flags, get_transcoder_entry(), rb_econv_t::num_trans, rb_econv_elem_t::out_buf_start, rb_transcoding_close(), rb_econv_elem_t::tc, rb_transcoding::transcoder, transcoder_entry_t::transcoder, and xfree.
| void rb_econv_check_error | ( | rb_econv_t * | ec | ) |
Definition at line 4213 of file transcode.c.
References make_econv_exception(), NIL_P, and rb_exc_raise().
| void rb_econv_close | ( | rb_econv_t * | ec | ) |
Definition at line 1702 of file transcode.c.
References rb_econv_t::elems, rb_econv_t::in_buf_start, rb_econv_t::num_trans, rb_econv_elem_t::out_buf_start, rb_transcoding_close(), rb_econv_t::replacement_allocated, rb_econv_t::replacement_str, rb_econv_elem_t::tc, and xfree.
| rb_econv_result_t rb_econv_convert | ( | rb_econv_t * | ec, |
| const unsigned char ** | source_buffer_ptr, | ||
| const unsigned char * | source_buffer_end, | ||
| unsigned char ** | destination_buffer_ptr, | ||
| unsigned char * | destination_buffer_end, | ||
| int | flags | ||
| ) |
Definition at line 1446 of file transcode.c.
References econv_incomplete_input, econv_invalid_byte_sequence, ECONV_INVALID_MASK, ECONV_INVALID_REPLACE, ECONV_UNDEF_HEX_CHARREF, ECONV_UNDEF_MASK, ECONV_UNDEF_REPLACE, econv_undefined_conversion, rb_econv_t::flags, output_hex_charref(), output_replacement_character(), rb_econv_convert0(), and rb_econv_t::started.
| int rb_econv_decorate_at_first | ( | rb_econv_t * | ec, |
| const char * | decorator_name | ||
| ) |
Definition at line 1908 of file transcode.c.
References asciicompat_decoder, rb_transcoder::asciicompat_type, DECORATOR_P, rb_transcoder::dst_encoding, rb_econv_t::elems, rb_econv_t::num_trans, rb_econv_decorate_at(), rb_transcoder::src_encoding, rb_econv_elem_t::tc, and rb_transcoding::transcoder.
| int rb_econv_decorate_at_last | ( | rb_econv_t * | ec, |
| const char * | decorator_name | ||
| ) |
Definition at line 1925 of file transcode.c.
References asciicompat_encoder, rb_transcoder::asciicompat_type, DECORATOR_P, rb_transcoder::dst_encoding, rb_econv_t::elems, rb_econv_t::num_trans, rb_econv_decorate_at(), rb_transcoder::src_encoding, rb_econv_elem_t::tc, and rb_transcoding::transcoder.
| const char* rb_econv_encoding_to_insert_output | ( | rb_econv_t * | ec | ) |
Definition at line 1503 of file transcode.c.
References asciicompat_encoder, rb_transcoder::asciicompat_type, rb_transcoder::dst_encoding, rb_econv_t::last_tc, NULL, rb_transcoder::src_encoding, and rb_transcoding::transcoder.
Definition at line 3169 of file transcode.c.
References Qnil, RTEST, search_convpath_i(), and transcode_search_path().
| int rb_econv_insert_output | ( | rb_econv_t * | ec, |
| const unsigned char * | str, | ||
| size_t | len, | ||
| const char * | str_encoding | ||
| ) |
Definition at line 1587 of file transcode.c.
References allocate_converted_string(), asciicompat_encoder, rb_transcoder::asciicompat_type, buf, rb_econv_t::elems, encoding_equal, fail, rb_econv_t::in_buf_end, rb_econv_t::in_buf_start, rb_econv_t::in_data_end, rb_econv_t::in_data_start, MEMMOVE, NULL, rb_econv_t::num_trans, rb_econv_elem_t::out_buf_end, rb_econv_elem_t::out_buf_start, rb_econv_elem_t::out_data_end, rb_econv_elem_t::out_data_start, rb_econv_encoding_to_insert_output(), rb_transcoding::readagain_len, rb_transcoding::recognized_len, rb_econv_t::started, rb_econv_elem_t::tc, rb_transcoding::transcoder, TRANSCODING_READBUF, xfree, xmalloc, and xrealloc.
| VALUE rb_econv_make_exception | ( | rb_econv_t * | ec | ) |
Definition at line 4207 of file transcode.c.
References make_econv_exception().
| rb_econv_t* rb_econv_open | ( | const char * | source_encoding, |
| const char * | destination_encoding, | ||
| int | ecflags | ||
| ) |
Definition at line 1067 of file transcode.c.
References decorator_names(), ECONV_ERROR_HANDLER_MASK, rb_econv_t::flags, MAX_ECFLAGS_DECORATORS, NULL, rb_econv_close(), rb_econv_decorate_at_last(), and rb_econv_open0().
Definition at line 2036 of file transcode.c.
References econv_description(), rb_eConverterNotFoundError, rb_exc_new3, rb_str_cat2(), and rb_str_new_cstr().
| rb_econv_t* rb_econv_open_opts | ( | const char * | source_encoding, |
| const char * | destination_encoding, | ||
| int | ecflags, | ||
| VALUE | ecopts | ||
| ) |
Definition at line 2578 of file transcode.c.
References NIL_P, NULL, OBJ_FROZEN, Qnil, rb_bug(), rb_econv_close(), rb_econv_open(), rb_econv_set_replacement(), rb_enc_get(), rb_enc_name, rb_hash_aref(), RB_TYPE_P, RSTRING_LEN, RSTRING_PTR, sym_replace, and T_HASH.
Definition at line 2527 of file transcode.c.
References econv_opts(), ENC_CODERANGE_BROKEN, NIL_P, Qnil, rb_check_hash_type(), rb_eArgError, rb_enc_get(), rb_enc_name, rb_enc_str_coderange(), rb_hash_aref(), rb_hash_aset(), rb_hash_freeze(), rb_hash_new(), rb_obj_is_method(), rb_obj_is_proc(), rb_raise(), rb_respond_to(), rb_str_dump(), rb_str_new_frozen(), StringValue, StringValueCStr, sym_aref, sym_fallback, and sym_replace.
Definition at line 2572 of file transcode.c.
References rb_econv_prepare_options().
| void rb_econv_putback | ( | rb_econv_t * | ec, |
| unsigned char * | p, | ||
| int | n | ||
| ) |
Definition at line 1753 of file transcode.c.
References rb_econv_t::elems, rb_econv_t::num_trans, rb_transcoding::readagain_len, rb_transcoding::recognized_len, rb_econv_elem_t::tc, and TRANSCODING_READBUF.
| int rb_econv_putbackable | ( | rb_econv_t * | ec | ) |
Definition at line 1742 of file transcode.c.
References rb_econv_t::elems, rb_econv_t::num_trans, rb_transcoding::readagain_len, and rb_econv_elem_t::tc.
| int rb_econv_set_replacement | ( | rb_econv_t * | ec, |
| const unsigned char * | str, | ||
| size_t | len, | ||
| const char * | encname | ||
| ) |
Definition at line 2198 of file transcode.c.
References allocate_converted_string(), encoding_equal, MEMCPY, NULL, rb_econv_encoding_to_insert_output(), rb_econv_t::replacement_allocated, rb_econv_t::replacement_enc, rb_econv_t::replacement_len, rb_econv_t::replacement_str, xfree, and xmalloc.
| VALUE rb_econv_str_append | ( | rb_econv_t * | ec, |
| VALUE | src, | ||
| VALUE | dst, | ||
| int | flags | ||
| ) |
Definition at line 1865 of file transcode.c.
References rb_econv_substr_append(), and RSTRING_LEN.
| VALUE rb_econv_str_convert | ( | rb_econv_t * | ec, |
| VALUE | src, | ||
| int | flags | ||
| ) |
Definition at line 1877 of file transcode.c.
References Qnil, rb_econv_substr_append(), and RSTRING_LEN.
| VALUE rb_econv_substr_append | ( | rb_econv_t * | ec, |
| VALUE | src, | ||
| long | byteoff, | ||
| long | bytesize, | ||
| VALUE | dst, | ||
| int | flags | ||
| ) |
Definition at line 1856 of file transcode.c.
References rb_econv_append(), RB_GC_GUARD, rb_str_new_frozen(), and RSTRING_PTR.
| VALUE rb_econv_substr_convert | ( | rb_econv_t * | ec, |
| VALUE | src, | ||
| long | byteoff, | ||
| long | bytesize, | ||
| int | flags | ||
| ) |
Definition at line 1871 of file transcode.c.
References Qnil, and rb_econv_substr_append().
| int rb_enc_ascget | ( | const char * | p, |
| const char * | e, | ||
| int * | len, | ||
| rb_encoding * | enc | ||
| ) |
Definition at line 970 of file encoding.c.
References c, ISASCII, MBCLEN_CHARFOUND_P, rb_enc_asciicompat, rb_enc_isascii, rb_enc_mbc_to_codepoint, and rb_enc_precise_mbclen().
Referenced by check_pipe_command(), chopped_length(), rb_reg_expr_str(), rb_reg_quote(), rb_str_casecmp(), rb_str_chomp_bang(), rb_str_split_m(), rmext(), str_end_with_asciichar(), swallow(), tr_setup_table(), tr_trans(), and trnext().
| VALUE rb_enc_associate | ( | VALUE | , |
| rb_encoding * | |||
| ) |
Definition at line 826 of file encoding.c.
References rb_enc_associate_index(), and rb_enc_to_index.
Referenced by append_fspath(), copy_home_path(), econv_primitive_convert(), econv_putback(), gzfile_getc(), gzfile_newstr(), intern_str(), io_enc_str(), io_shift_cbuf(), lex_getline(), load_file_internal(), locale_path(), parser_nextc(), parser_str_new(), process_options(), rb_ary_join(), rb_check_id_cstr(), rb_dir_getwd(), rb_econv_append(), rb_enc_reg_error_desc(), rb_enc_str_new(), rb_enc_vsprintf(), rb_external_str_with_enc(), rb_file_expand_path_internal(), rb_file_join(), rb_intern3(), rb_nkf_convert(), rb_reg_desc(), rb_reg_initialize(), rb_reg_preprocess(), rb_reg_preprocess_dregexp(), rb_reg_quote(), rb_reg_s_union(), rb_reg_to_s(), rb_str_append(), rb_str_concat(), rb_str_conv_enc_opts(), rb_str_dump(), rb_str_ellipsize(), rb_str_force_encoding(), rb_str_format(), rb_str_inspect(), rb_str_justify(), rb_str_shared_replace(), rb_str_splice(), rb_str_sub_bang(), rb_str_subpat_set(), reg_fragment_setenc_gen(), require_libraries(), ruby__sfvextra(), str_gsub(), strio_read(), strio_set_encoding(), syserr_initialize(), and tr_trans().
Definition at line 798 of file encoding.c.
References rb_encoding_entry::enc, ENC_CODERANGE_ASCIIONLY, ENC_CODERANGE_CLEAR, enc_set_index(), must_encindex(), rb_check_frozen, rb_eArgError, rb_enc_asciicompat, rb_enc_from_index(), rb_enc_get_index(), rb_enc_mbminlen, rb_raise(), rb_str_fill_terminator(), RB_TYPE_P, SPECIAL_CONST_P, and T_STRING.
Referenced by encoded_dup(), lib_fromUTF8_core(), lib_split_tklist_core(), lib_toUTF8_core(), lib_UTF_backslash_core(), make_econv_exception(), parser_set_encode(), r_ivar(), r_symreal(), rb_enc_associate(), rb_enc_copy(), rb_find_file_ext_safe(), rb_find_file_safe(), str_encode_associate(), and str_encode_bang().
| int rb_enc_casefold | ( | char * | to, |
| const char * | p, | ||
| const char * | e, | ||
| rb_encoding * | enc | ||
| ) |
| rb_encoding* rb_enc_check | ( | VALUE | , |
| VALUE | |||
| ) |
Definition at line 838 of file encoding.c.
References rb_encoding_entry::enc, rb_eEncCompatError, rb_enc_compatible(), rb_enc_get(), rb_enc_name, and rb_raise().
Referenced by append_fspath(), rb_file_expand_path_internal(), rb_file_join(), rb_str_append(), rb_str_chomp_bang(), rb_str_count(), rb_str_delete_bang(), rb_str_end_with(), rb_str_enumerate_lines(), rb_str_format(), rb_str_index(), rb_str_index_m(), rb_str_justify(), rb_str_plus(), rb_str_rindex(), rb_str_splice(), rb_str_split_m(), rb_str_squeeze_bang(), rb_str_start_with(), rb_str_subpat_set(), rb_str_upto(), readline_attempted_completion_function(), realpath_rec(), and tr_trans().
| int rb_enc_code_to_mbclen | ( | int | code, |
| rb_encoding * | enc | ||
| ) |
Definition at line 1025 of file encoding.c.
References ONIGENC_CODE_TO_MBCLEN, and rb_enc_code_to_mbclen.
| int rb_enc_codelen | ( | int | code, |
| rb_encoding * | enc | ||
| ) |
Definition at line 1014 of file encoding.c.
References ONIGENC_CODE_TO_MBCLEN, rb_eArgError, rb_enc_name, and rb_raise().
Referenced by parser_tokaddmbc(), rb_enc_uint_chr(), rb_str_buf_cat_ascii(), rb_str_concat(), rb_str_format(), strio_ungetc(), and tr_trans().
| unsigned int rb_enc_codepoint | ( | const char * | p, |
| const char * | e, | ||
| rb_encoding * | enc | ||
| ) |
Definition at line 1008 of file encoding.c.
References rb_enc_codepoint, and rb_enc_codepoint_len().
| unsigned int rb_enc_codepoint_len | ( | const char * | p, |
| const char * | e, | ||
| int * | len, | ||
| rb_encoding * | enc | ||
| ) |
Definition at line 993 of file encoding.c.
References MBCLEN_CHARFOUND_LEN, MBCLEN_CHARFOUND_P, rb_eArgError, rb_enc_mbc_to_codepoint, rb_enc_name, rb_enc_precise_mbclen(), and rb_raise().
Referenced by rb_enc_codepoint(), rb_str_capitalize_bang(), rb_str_count(), rb_str_delete_bang(), rb_str_downcase_bang(), rb_str_enumerate_codepoints(), rb_str_format(), rb_str_lstrip_bang(), rb_str_split_m(), rb_str_squeeze_bang(), rb_str_swapcase_bang(), rb_str_upcase_bang(), readline_attempted_completion_function(), rmext(), strio_each_codepoint(), sym_printable(), tr_trans(), and trnext().
| rb_encoding* rb_enc_compatible | ( | VALUE | , |
| VALUE | |||
| ) |
Definition at line 849 of file encoding.c.
References ENC_CODERANGE_7BIT, rb_enc_asciicompat, rb_enc_from_index(), rb_enc_get_index(), rb_enc_str_asciionly_p(), rb_enc_str_coderange(), RB_TYPE_P, RSTRING_LEN, and T_STRING.
Referenced by enc_compatible_p(), file_s_fnmatch(), literal_concat0(), location_format(), match_aref(), rb_enc_check(), rb_file_s_basename(), rb_reg_regsub(), rb_str_casecmp(), rb_str_sub_bang(), and ruby__sfvextra().
Definition at line 916 of file encoding.c.
References rb_enc_associate_index(), and rb_enc_get_index().
Referenced by ary_join_0(), ary_join_1(), date_s__parse_internal(), date_s__strptime_internal(), date_strftime_internal(), inspect_ary(), inspect_i(), rb_check_id(), rb_file_dirname(), rb_file_expand_path_internal(), rb_file_join(), rb_file_s_basename(), rb_reg_desc(), rb_reg_quote(), rb_reg_s_union(), rb_reg_to_s(), rb_str_format(), str_new(), str_new_empty(), and strio_read().
| VALUE rb_enc_default_external | ( | void | ) |
Definition at line 1365 of file encoding.c.
References rb_default_external_encoding(), and rb_enc_from_encoding().
Referenced by encoding_table_get_name_core(), and get_default_external().
| VALUE rb_enc_default_internal | ( | void | ) |
Definition at line 1445 of file encoding.c.
References rb_default_internal_encoding(), and rb_enc_from_encoding().
Referenced by encoding_table_get_name_core(), get_default_internal(), and str_transcode0().
|
inlinestatic |
Definition at line 245 of file encoding.h.
References ENC_DUMMY_P.
| int rb_enc_fast_mbclen | ( | const char * | p, |
| const char * | e, | ||
| rb_encoding * | enc | ||
| ) |
Definition at line 940 of file encoding.c.
References ONIGENC_MBC_ENC_LEN, and UChar.
Referenced by enc_strlen(), rb_str_enumerate_chars(), rb_str_reverse(), rb_str_split_m(), scan_once(), and str_gsub().
| rb_encoding* rb_enc_find | ( | const char * | name | ) |
Definition at line 708 of file encoding.c.
References rb_enc_find_index(), and rb_enc_from_index().
Referenced by econv_get_replacement(), econv_insert_output(), make_encoding(), make_replacement(), and transcode_loop().
| int rb_enc_find_index | ( | const char * | name | ) |
Definition at line 684 of file encoding.c.
References rb_encoding_entry::enc, enc_autoload(), enc_autoload_p, load_encoding(), rb_eArgError, rb_enc_from_index(), rb_enc_registered(), rb_raise(), rb_warn(), and UNSPECIFIED_ENCODING.
Referenced by create_dummy_encoding_for_tk_core(), create_encoding_table_core(), encoding_table_get_name_core(), id2encidx(), Init_enc_set_filesystem_encoding(), Init_tcltklib(), lib_fromUTF8_core(), make_econv_exception(), ole_cp2encoding(), opt_enc_index(), parse_mode_enc(), parser_set_encode(), process_options(), rb_econv_open0(), rb_enc_alias(), rb_enc_find(), rb_locale_encindex(), rb_nkf_enc_get(), rb_to_encoding_index(), str_find_encindex(), transcode_io(), transcode_string(), and update_encoding_table().
| VALUE rb_enc_from_encoding | ( | rb_encoding * | enc | ) |
Definition at line 102 of file encoding.c.
References ENC_TO_ENCINDEX, Qnil, and rb_enc_from_encoding_index().
Referenced by argf_external_encoding(), argf_internal_encoding(), create_dummy_encoding_for_tk_core(), create_encoding_table_core(), do_writeconv(), econv_destination_encoding(), econv_insert_output(), econv_s_asciicompat_encoding(), econv_source_encoding(), enc_compatible_p(), encoding_table_get_name_core(), get_user_from_path(), gettable_gen(), Init_nkf(), io_set_encoding_by_bom(), load_file_internal(), make_econv_exception(), make_encobj(), process_options(), rb_enc_default_external(), rb_enc_default_internal(), rb_file_expand_path_internal(), rb_io_external_encoding(), rb_io_getline_1(), rb_io_internal_encoding(), rb_nkf_guess(), rb_parser_encoding(), rb_reg_to_s(), rb_str_ellipsize(), rb_str_enumerate_lines(), readline_attempted_completion_function(), set_encoding_const(), strio_external_encoding(), and update_encoding_table().
| rb_encoding* rb_enc_from_index | ( | int | idx | ) |
Definition at line 590 of file encoding.c.
References ENC_INDEX_MASK, enc_table, and rb_enc_init().
Referenced by check_encoding(), create_dummy_encoding_for_tk_core(), create_encoding_table_core(), dump_object(), econv_args(), enc_alias(), enc_arg(), enc_inspect(), enc_replicate_with_index(), encoding_table_get_name_core(), file_path_convert(), get_actual_encoding(), io_set_encoding_by_bom(), load_file_internal(), make_dummy_encoding(), make_econv_exception(), must_encindex(), ole_cp2encoding(), opt_enc_index(), parse_mode_enc(), parser_set_encode(), process_options(), rb_default_external_encoding(), rb_default_internal_encoding(), rb_econv_open0(), rb_enc_aliases_enc_i(), rb_enc_associate_index(), rb_enc_compatible(), rb_enc_cr_str_buf_cat(), rb_enc_find(), rb_enc_find_index(), rb_enc_get(), rb_enc_register(), rb_enc_replicate(), rb_enc_set_base(), rb_encdb_declare(), rb_encdb_replicate(), rb_encdb_set_unicode(), rb_filesystem_encoding(), rb_find_encoding(), rb_io_extract_encoding_option(), rb_locale_encoding(), rb_nkf_enc_get(), rb_str_buf_cat_ascii(), rb_str_comparable(), rb_str_inspect(), rb_w32_conv_from_wchar(), rb_w32_write_console(), str_encode_associate(), str_end_with_asciichar(), str_to_encoding(), str_transcode_enc_args(), update_encoding_table(), and w_encoding().
| rb_encoding* rb_enc_get | ( | VALUE | ) |
Definition at line 832 of file encoding.c.
References rb_enc_from_index(), and rb_enc_get_index().
Referenced by check_dirname(), check_path_encoding(), check_pipe_command(), do_writeconv(), econv_set_replacement(), file_s_fnmatch(), fnmatch_brace(), intern_str(), io_encoding_set(), literal_concat0(), must_be_ascii_compatible(), must_not_be_anonymous(), ole_vstr2wc(), parser_prepare(), parser_yyerror(), path_check_0(), path_sub_ext(), prepare_getline_args(), push_glob(), rb_econv_open_opts(), rb_econv_prepare_options(), rb_enc_check(), rb_file_dirname(), rb_file_expand_path_internal(), rb_file_join(), rb_file_s_basename(), rb_file_s_extname(), rb_gzreader_ungetc(), rb_gzwriter_write(), rb_inspect(), rb_mod_const_defined(), rb_mod_const_get(), rb_must_asciicompat(), rb_path_to_class(), rb_push_glob(), rb_realpath_internal(), rb_reg_check_preprocess(), rb_reg_desc(), rb_reg_error_desc(), rb_reg_init_copy(), rb_reg_initialize_m(), rb_reg_initialize_str(), rb_reg_prepare_enc(), rb_reg_preprocess_dregexp(), rb_reg_quote(), rb_reg_regsub(), rb_reg_s_union(), rb_reg_source(), rb_reg_to_s(), rb_str_chomp_bang(), rb_str_conv_enc_opts(), rb_str_dump(), rb_str_ellipsize(), rb_str_encode_ospath(), rb_str_enumerate_chars(), rb_str_enumerate_lines(), rb_str_fill_terminator(), rb_str_format(), rb_str_symname_type(), rb_string_value_cstr(), rb_to_encoding_index(), realpath_rec(), reg_enc_error(), reg_fragment_setenc_gen(), reg_named_capture_assign_gen(), ruby__sfvextra(), str_find_encindex(), strio_each_codepoint(), strio_external_encoding(), strio_getc(), strio_getline(), strio_substr(), strio_ungetc(), strio_write(), strscan_getch(), sym_check_asciionly(), syserr_initialize(), time_strftime(), transcode_loop(), and update_char_offset().
| int rb_enc_get_index | ( | VALUE | obj | ) |
Definition at line 739 of file encoding.c.
References BUILTIN_TYPE, enc_check_encoding(), ENCODING_GET_INLINED, ENCODING_INLINE_MAX, is_data_encoding, NIL_P, NUM2INT, rb_funcall(), rb_id2str(), rb_id_encoding(), rb_intern, rb_ivar_get(), SPECIAL_CONST_P, SYM2ID, SYMBOL_P, T_DATA, T_FILE, T_REGEXP, and T_STRING.
Referenced by lib_fromUTF8_core(), lib_split_tklist_core(), rb_enc_associate_index(), rb_enc_compatible(), rb_enc_copy(), rb_enc_get(), rb_obj_encoding(), str_transcode_enc_args(), transcode_string(), w_encoding(), and w_symbol().
| int rb_enc_mbclen | ( | const char * | p, |
| const char * | e, | ||
| rb_encoding * | enc | ||
| ) |
Definition at line 946 of file encoding.c.
References MBCLEN_CHARFOUND_LEN, MBCLEN_CHARFOUND_P, ONIGENC_PRECISE_MBC_ENC_LEN, rb_enc_mbminlen, and UChar.
Referenced by bracket(), enc_strlen(), gzfile_getc(), intern_str(), io_getc(), is_special_global_name(), rb_enc_symname_type(), rb_str_casecmp(), rb_str_enumerate_chars(), rb_str_enumerate_lines(), rb_str_format(), rb_str_reverse(), str_nth_len(), str_null_char(), strio_getc(), strio_ungetc(), and strscan_getch().
| char* rb_enc_nth | ( | const char * | , |
| const char * | , | ||
| long | , | ||
| rb_encoding * | |||
| ) |
Definition at line 1753 of file string.c.
References str_nth_len().
| char* rb_enc_path_end | ( | const char * | , |
| const char * | , | ||
| rb_encoding * | |||
| ) |
Definition at line 2928 of file file.c.
References chompdirsep(), and isdirsep.
| char* rb_enc_path_last_separator | ( | const char * | , |
| const char * | , | ||
| rb_encoding * | |||
| ) |
| char* rb_enc_path_next | ( | const char * | , |
| const char * | , | ||
| rb_encoding * | |||
| ) |
| char* rb_enc_path_skip_prefix | ( | const char * | , |
| const char * | , | ||
| rb_encoding * | |||
| ) |
Definition at line 2860 of file file.c.
References isdirsep, and rb_enc_path_next().
| int rb_enc_precise_mbclen | ( | const char * | p, |
| const char * | e, | ||
| rb_encoding * | enc | ||
| ) |
Definition at line 958 of file encoding.c.
References ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE, ONIGENC_PRECISE_MBC_ENC_LEN, and UChar.
Referenced by coderange_scan(), enc_pred_char(), enc_succ_char(), fnmatch_helper(), gzreader_charboundary(), io_getc(), make_econv_exception(), rb_enc_ascget(), rb_enc_codepoint_len(), rb_enc_strlen_cr(), rb_enc_uint_chr(), rb_io_each_codepoint(), rb_io_getline_1(), rb_reg_expr_str(), rb_str_coderange_scan_restartable(), rb_str_concat(), rb_str_dump(), rb_str_inspect(), rb_str_scrub(), rb_str_succ(), unescape_escaped_nonascii(), and unescape_nonascii().
| VALUE rb_enc_reg_new | ( | const char * | , |
| long | , | ||
| rb_encoding * | , | ||
| int | |||
| ) |
Definition at line 2529 of file re.c.
References err, NULL, rb_enc_reg_raise(), rb_reg_alloc(), and rb_reg_initialize().
| int rb_enc_replicate | ( | const char * | , |
| rb_encoding * | |||
| ) |
Definition at line 380 of file encoding.c.
References enc_check_duplication(), enc_register(), rb_enc_from_index(), set_base_encoding(), and set_encoding_const().
Referenced by enc_replicate(), and rb_define_dummy_encoding().
| void rb_enc_set_default_external | ( | VALUE | encoding | ) |
Definition at line 1403 of file encoding.c.
References enc_set_default_encoding(), NIL_P, rb_eArgError, and rb_raise().
Referenced by process_options(), and set_default_external().
| void rb_enc_set_default_internal | ( | VALUE | encoding | ) |
Definition at line 1488 of file encoding.c.
References enc_set_default_encoding().
Referenced by process_options(), and set_default_internal().
| void rb_enc_set_index | ( | VALUE | obj, |
| int | encindex | ||
| ) |
Definition at line 790 of file encoding.c.
References enc_set_index(), must_encindex(), and rb_check_frozen.
Referenced by str_enc_copy().
| int rb_enc_str_asciionly_p | ( | VALUE | ) |
Definition at line 448 of file string.c.
References ENC_CODERANGE_7BIT, FALSE, rb_enc_asciicompat, rb_enc_str_coderange(), STR_ENC_GET, and TRUE.
| VALUE rb_enc_str_buf_cat | ( | VALUE | str, |
| const char * | ptr, | ||
| long | len, | ||
| rb_encoding * | enc | ||
| ) |
Definition at line 2251 of file string.c.
References ENC_CODERANGE_UNKNOWN, NULL, rb_enc_cr_str_buf_cat(), and rb_enc_to_index.
| int rb_enc_str_coderange | ( | VALUE | ) |
Definition at line 435 of file string.c.
References coderange_scan(), ENC_CODERANGE, ENC_CODERANGE_SET, ENC_CODERANGE_UNKNOWN, RSTRING_LEN, RSTRING_PTR, and STR_ENC_GET.
| VALUE rb_enc_str_new | ( | const char * | , |
| long | , | ||
| rb_encoding * | |||
| ) |
Definition at line 548 of file string.c.
References rb_cString, rb_enc_associate(), rb_enc_mbminlen, rb_str_new(), and str_new0().
| VALUE rb_enc_str_new_cstr | ( | const char * | , |
| rb_encoding * | |||
| ) |
Definition at line 577 of file string.c.
References rb_eArgError, rb_enc_mbminlen, rb_enc_str_new(), rb_raise(), and strlen().
| long rb_enc_strlen | ( | const char * | , |
| const char * | , | ||
| rb_encoding * | |||
| ) |
Definition at line 1141 of file string.c.
References ENC_CODERANGE_UNKNOWN, and enc_strlen().
| int rb_enc_symname2_p | ( | const char * | , |
| long | , | ||
| rb_encoding * | |||
| ) |
Definition at line 16935 of file ripper.c.
References IDSET_ATTRSET_FOR_SYNTAX, and rb_enc_symname_type().
Referenced by rb_enc_symname_p(), and reg_named_capture_assign_iter().
| int rb_enc_symname_p | ( | const char * | , |
| rb_encoding * | |||
| ) |
Definition at line 16830 of file ripper.c.
References rb_enc_symname2_p(), and strlen().
Referenced by rb_str_symname_p(), and rb_symname_p().
| int rb_enc_tolower | ( | int | c, |
| rb_encoding * | enc | ||
| ) |
Definition at line 1037 of file encoding.c.
References ONIGENC_ASCII_CODE_TO_LOWER_CASE, and ONIGENC_IS_ASCII_CODE.
Referenced by rb_str_capitalize_bang(), rb_str_downcase_bang(), and rb_str_swapcase_bang().
| int rb_enc_toupper | ( | int | c, |
| rb_encoding * | enc | ||
| ) |
Definition at line 1031 of file encoding.c.
References ONIGENC_ASCII_CODE_TO_UPPER_CASE, and ONIGENC_IS_ASCII_CODE.
Referenced by bracket(), fnmatch_helper(), rb_str_capitalize_bang(), rb_str_format(), rb_str_swapcase_bang(), and rb_str_upcase_bang().
| VALUE rb_enc_uint_chr | ( | unsigned int | code, |
| rb_encoding * | enc | ||
| ) |
Definition at line 2514 of file numeric.c.
References ONIGERR_INVALID_CODE_POINT_VALUE, ONIGERR_TOO_BIG_WIDE_CHAR_VALUE, rb_enc_codelen(), rb_enc_mbcput, rb_enc_name, rb_enc_precise_mbclen(), rb_enc_str_new(), rb_eRangeError, rb_raise(), RSTRING_END, and RSTRING_PTR.
| int rb_enc_unicode_p | ( | rb_encoding * | enc | ) |
Definition at line 496 of file encoding.c.
References ONIGENC_IS_UNICODE.
Referenced by rb_reg_expr_str(), and rb_str_inspect().
| VALUE rb_enc_vsprintf | ( | rb_encoding * | , |
| const char * | , | ||
| va_list | |||
| ) |
Definition at line 1198 of file sprintf.c.
References __SSTR, __SWR, BSD_vfprintf(), f, rb_cString, rb_eArgError, rb_enc_associate(), rb_enc_mbminlen, rb_enc_name, rb_raise(), rb_str_buf_new(), rb_str_resize(), RBASIC_CLEAR_CLASS, RBASIC_SET_CLASS_RAW, result, RSTRING_PTR, ruby__sfvextra(), ruby__sfvwrite(), and rb_printf_buffer_extra::value.
Definition at line 839 of file eval.c.
References rb_ensure_entry::data2, rb_ensure_entry::e_proc, rb_thread_struct::ensure_list, rb_ensure_list::entry, rb_thread_struct::errinfo, EXEC_TAG, GET_THREAD(), JUMP_TAG, rb_ensure_entry::marker, rb_ensure_list::next, POP_TAG, PUSH_TAG, Qnil, and result.
Referenced by _thread_call_proc(), check_autoload_required(), dir_entries(), dir_foreach(), dir_s_chdir(), dir_s_open(), fdbm_s_open(), fgdbm_s_open(), fole_each(), fsdbm_s_open(), gzfile_reader_end(), gzfile_wrap(), gzfile_writer_end(), io_s_write(), lib_eventloop_launcher(), lib_mainloop_watchdog(), load_file(), mSyslog_open(), p_gid_switch(), p_uid_switch(), pipe_pair_close(), pty_getpty(), pty_open(), queue_do_pop(), rb_autoload_load(), rb_condvar_wait(), rb_deflate_s_deflate(), rb_dlhandle_initialize(), rb_f_open(), rb_f_select(), rb_fiddle_handle_initialize(), rb_gvar_set(), rb_hash_assoc(), rb_hash_foreach(), rb_inflate_s_inflate(), rb_io_s_binread(), rb_io_s_copy_stream(), rb_io_s_foreach(), rb_io_s_open(), rb_io_s_pipe(), rb_io_s_popen(), rb_io_s_read(), rb_io_s_readlines(), rb_io_sysread(), rb_mutex_sleep(), rb_mutex_synchronize(), rb_objspace_each_objects(), rb_str_locktmp_ensure(), rb_szqueue_push(), rb_uninterruptible(), rb_wait_for_single_fd(), rsock_init_inetsock(), rsock_make_hostent(), strio_s_open(), thread_join(), trace_object_allocations(), tracepoint_disable_m(), tracepoint_enable_m(), and udp_connect().
Definition at line 33 of file enum.c.
References Qnil, and rb_ary_new4.
Referenced by collect_all(), drop_i(), each_with_index_i(), lazy_grep_func(), lazy_grep_iter(), lazy_reject_func(), lazy_select_func(), member_i(), take_i(), take_while_i(), zip_ary(), and zip_i().
Definition at line 401 of file enumerator.c.
References rb_enumeratorize_with_size.
Referenced by argf_bytes(), argf_chars(), argf_codepoints(), argf_lines(), rb_gzreader_bytes(), rb_gzreader_lines(), rb_io_bytes(), rb_io_chars(), rb_io_codepoints(), rb_io_lines(), strio_bytes(), strio_chars(), strio_codepoints(), and strio_lines().
| VALUE rb_enumeratorize_with_size | ( | VALUE | , |
| VALUE | , | ||
| int | , | ||
| VALUE * | , | ||
| rb_enumerator_size_func * | |||
| ) |
Definition at line 410 of file enumerator.c.
References enumerator_allocate(), enumerator_init(), lazy_to_enum_i(), Qnil, rb_cEnumerator, rb_cLazy, rb_enumeratorize_with_size, rb_obj_is_kind_of(), and RTEST.
| VALUE rb_env_clear | ( | void | ) |
Definition at line 3216 of file hash.c.
References env_delete(), env_keys(), envtbl, NIL_P, Qnil, RARRAY_AREF, RARRAY_LEN, rb_f_getenv(), and val.
| int rb_env_path_tainted | ( | void | ) |
Definition at line 2676 of file hash.c.
References getenv, PATH_ENV, path_tainted, and path_tainted_p().
Definition at line 100 of file object.c.
References id_eql, rb_funcall(), and RTEST.
Definition at line 901 of file vm_insnhelper.c.
References rb_call_info_struct::defined_class, idEq, rb_call_info_struct::klass, rb_call_info_struct::me, rb_call_info_struct::method_state, rb_call_info_struct::mid, NULL, and opt_eq_func().
| VALUE rb_errinfo | ( | void | ) |
Definition at line 1497 of file eval.c.
References rb_thread_struct::errinfo, and GET_THREAD().
Definition at line 1463 of file vm_eval.c.
References eval_string(), EXEC_TAG, JUMP_TAG, OBJ_TAINTED, POP_TAG, PUSH_TAG, Qnil, RARRAY_LENINT, RARRAY_PTR, rb_funcall2, rb_intern, rb_safe_level, rb_set_safe_level_force(), RB_TYPE_P, rb_vm_top_self(), and T_STRING.
Evaluates the given string in an isolated binding.
Here "isolated" means the binding does not inherit any other binding. This behaves same as the binding for required libraries.
FILE will be "(eval)", and LINE starts from 1 in the evaluation.
| str | Ruby code to evaluate. |
| Exception | Raises an exception on error. |
Definition at line 1403 of file vm_eval.c.
References ruby_eval_string_from_file().
Evaluates the given string in an isolated binding.
FILE will be "(eval)", and LINE starts from 1 in the evaluation.
| str | Ruby code to evaluate. |
| state | Being set to zero if succeeded. Nonzero if an error occurred. |
Definition at line 1419 of file vm_eval.c.
References rb_eval_string(), and rb_protect().
Evaluates the given string under a module binding in an isolated binding.
This is same as the binding for required libraries on "require('foo', true)".
FILE will be "(eval)", and LINE starts from 1 in the evaluation.
| str | Ruby code to evaluate. |
| state | Being set to zero if succeeded. Nonzero if an error occurred. |
Definition at line 1436 of file vm_eval.c.
References GET_THREAD(), JUMP_TAG, rb_eval_string_protect(), rb_extend_object(), rb_module_new(), rb_obj_clone(), rb_vm_top_self(), rb_thread_struct::top_self, and rb_thread_struct::top_wrapper.
Definition at line 573 of file error.c.
References rb_funcall(), rb_intern, and rb_str_new().
Referenced by rb_exc_new_cstr(), rb_threadptr_raise(), and setup_exception().
Definition at line 579 of file error.c.
References rb_exc_new(), and strlen().
Referenced by exc_setup_cause().
Definition at line 585 of file error.c.
References rb_funcall(), rb_intern, and StringValue.
Referenced by create_ip_exc(), ole_raise(), raise_from_check(), and raise_zlib_error().
| int rb_exec_async_signal_safe | ( | const struct rb_execarg * | e, |
| char * | errmsg, | ||
| size_t | errmsg_buflen | ||
| ) |
Definition at line 3104 of file process.c.
References after_exec_async_signal_safe(), before_exec_async_signal_safe(), rb_execarg::cmd, rb_execarg::envp_str, rb_execarg::invoke, NIL_P, NULL, preserving_errno, proc_exec_cmd(), proc_exec_sh(), rb_execarg_run_options(), RSTRING_PTR, rb_execarg::sh, and rb_execarg::use_shell.
| void rb_exec_end_proc | ( | void | ) |
Definition at line 112 of file eval_jump.c.
References rb_thread_struct::errinfo, error_handle(), exec_end_procs_chain(), EXEC_TAG, GET_THREAD(), NIL_P, POP_TAG, PUSH_TAG, rb_safe_level, rb_set_safe_level_force(), end_proc_data::safe, TH_REPUSH_TAG, and TH_TMPPOP_TAG.
Referenced by ruby_finalize_0().
Definition at line 4982 of file thread.c.
References exec_recursive(), and func.
Definition at line 5005 of file thread.c.
References exec_recursive(), and func.
Definition at line 4993 of file thread.c.
References exec_recursive(), func, and rb_obj_id().
Definition at line 5017 of file thread.c.
References exec_recursive(), func, and rb_obj_id().
Definition at line 1670 of file process.c.
References rb_execarg::chdir_dir, rb_execarg::chdir_given, check_exec_redirect(), check_gid_switch(), check_uid_switch(), rb_execarg::close_others_do, rb_execarg::close_others_given, EXPORT_DUP, FilePathValue, rb_execarg::gid, rb_execarg::gid_given, hide_obj(), id, INT2FIX, INT2NUM, mode_t, rb_execarg::new_pgroup_flag, rb_execarg::new_pgroup_given, NIL_P, NUM2MODET, NUM2PIDT, OBJ2GID, OBJ2UID, rb_execarg::pgroup_given, rb_execarg::pgroup_pgid, Qfalse, Qtrue, RARRAY_LEN, rb_ary_entry(), rb_ary_new(), rb_ary_new3, rb_ary_push(), rb_check_array_type(), rb_eArgError, rb_eNotImpError, rb_execarg_get(), RB_GC_GUARD, rb_id2name(), rb_intern, rb_raise(), rb_secure(), rb_to_int(), rb_execarg::rlimit_limits, RTEST, ST_CONTINUE, ST_STOP, SYM2ID, T_ARRAY, T_FILE, T_FIXNUM, T_SYMBOL, TYPE, rb_execarg::uid, rb_execarg::uid_given, rb_execarg::umask_given, rb_execarg::umask_mask, rb_execarg::unsetenv_others_do, and rb_execarg::unsetenv_others_given.
Definition at line 1959 of file process.c.
References check_exec_options_i_extract(), Qnil, rb_hash_tbl_raw(), RHASH_EMPTY_P, st_data_t, and st_foreach().
| void rb_execarg_fixup | ( | VALUE | execarg_obj | ) |
Definition at line 2325 of file process.c.
References check_exec_fds(), rb_execarg::dup2_tmpbuf, rb_execarg::env_modification, rb_execarg::envp_buf, rb_execarg::envp_str, envtbl, rb_execarg::fd_dup2, fill_envp_buf_i(), hide_obj(), key, NIL_P, NULL, Qfalse, Qundef, RARRAY_AREF, RARRAY_LEN, rb_cObject, rb_const_get(), rb_convert_type(), rb_execarg_get(), RB_GC_GUARD, rb_hash_new(), rb_intern, RB_OBJ_WRITTEN, rb_str_buf_cat(), rb_str_buf_new(), rb_str_new(), rb_str_set_len(), rb_execarg::redirect_fds, RHASH_SIZE, RHASH_TBL_RAW, RSTRING_LEN, RSTRING_PTR, run_exec_dup2_tmpbuf_size(), st_data_t, st_delete(), st_foreach(), st_insert(), strlen(), T_HASH, tmpbuf, rb_execarg::unsetenv_others_do, rb_execarg::unsetenv_others_given, and val.
|
read |
Definition at line 2272 of file process.c.
References exec_arg_data_type, and TypedData_Get_Struct.
Definition at line 2280 of file process.c.
References rb_execarg::cmd, env, rb_execarg::invoke, Qnil, rb_exec_fillarg(), rb_exec_getargs(), rb_execarg_get(), RB_GC_GUARD, rb_execarg::sh, and rb_execarg::use_shell.
Definition at line 2261 of file process.c.
References exec_arg_data_type, hide_obj(), rb_cData, rb_execarg_init(), and TypedData_Make_Struct.
| int rb_execarg_run_options | ( | const struct rb_execarg * | e, |
| struct rb_execarg * | s, | ||
| char * | errmsg, | ||
| size_t | errmsg_buflen | ||
| ) |
Definition at line 2957 of file process.c.
References rb_execarg::chdir_dir, rb_execarg::chdir_given, rb_execarg::close_others_do, rb_execarg::close_others_given, rb_execarg::close_others_maxhint, rb_execarg::dup2_tmpbuf, rb_execarg::env_modification, ERRMSG, rb_execarg::fd_close, rb_execarg::fd_dup2, rb_execarg::fd_dup2_child, rb_execarg::fd_open, rb_execarg::gid, rb_execarg::gid_given, hide_obj(), key, MEMZERO, mode_t, my_getcwd, NIL_P, rb_execarg::pgroup_given, Qfalse, Qnil, RARRAY_AREF, RARRAY_LEN, rb_close_before_exec(), rb_env_clear(), rb_str_new(), rb_str_new2, rb_str_set_len(), rb_warn(), rb_execarg::redirect_fds, rb_execarg::rlimit_limits, RSTRING_PTR, ruby_setenv(), run_exec_close(), run_exec_dup2(), run_exec_dup2_child(), run_exec_dup2_tmpbuf_size(), run_exec_open(), save_env(), setgid(), setuid(), StringValueCStr, tmpbuf, rb_execarg::uid, rb_execarg::uid_given, umask(), rb_execarg::umask_given, rb_execarg::umask_mask, rb_execarg::unsetenv_others_do, rb_execarg::unsetenv_others_given, val, and xfree.
Definition at line 2299 of file process.c.
References rb_execarg::env_modification, NIL_P, Qfalse, rb_check_exec_env(), and rb_execarg_get().
Definition at line 1305 of file eval.c.
References rb_include_module(), and rb_singleton_class().
Referenced by append_extmod(), Init_etc(), Init_Hash(), Init_readline(), mSyslogMacros_included(), r_object0(), rb_eval_string_wrap(), rb_load_internal0(), rb_mod_extend_object(), rb_mod_sys_fail(), rb_mod_sys_fail_str(), rb_mod_syserr_fail(), and rb_mod_syserr_fail_str().
Definition at line 707 of file string.c.
References rb_default_external_encoding(), and rb_external_str_new_with_enc().
Definition at line 713 of file string.c.
References rb_default_external_encoding(), rb_external_str_new_with_enc(), and strlen().
| VALUE rb_external_str_new_with_enc | ( | const char * | ptr, |
| long | len, | ||
| rb_encoding * | |||
| ) |
Definition at line 686 of file string.c.
References rb_external_str_with_enc(), and rb_tainted_str_new().
Definition at line 3732 of file process.c.
References EXIT_FAILURE, GET_THREAD(), INT2NUM, NIL_P, rb_class_new_instance(), rb_eSystemExit, rb_exc_raise(), rb_exit(), rb_io_puts(), rb_scan_args(), rb_stderr, ruby_error_print(), StringValue, and UNREACHABLE.
Definition at line 2482 of file process.c.
References CHILD_ERRMSG_BUFLEN, rb_execarg::cmd, rb_execarg::invoke, Qnil, rb_exec_async_signal_safe(), rb_exec_without_timer_thread(), rb_execarg_fixup(), rb_execarg_get(), rb_execarg_new(), RB_GC_GUARD, rb_sys_fail(), rb_sys_fail_str(), rb_execarg::sh, TRUE, and rb_execarg::use_shell.
Definition at line 3703 of file process.c.
References exit_status_code(), EXIT_SUCCESS, rb_exit(), rb_scan_args(), and UNREACHABLE.
| VALUE rb_f_global_variables | ( | void | ) |
Definition at line 853 of file variable.c.
References buf, gvar_i(), ID2SYM, rb_ary_new(), rb_ary_push(), rb_intern2(), and st_foreach_safe().
Definition at line 384 of file signal.c.
References argc, FIX2INT, GET_THREAD(), GET_VM, INT2FIX, kill(), killpg, NIL_P, NUM2PIDT, rb_check_arity, rb_check_string_type(), rb_eArgError, rb_id2name(), rb_obj_classname(), rb_raise(), rb_secure(), rb_sys_fail(), rb_thread_current(), rb_thread_execute_interrupts(), rb_threadptr_check_signal(), RSTRING_PTR, ruby_kill(), SIGKILL, signal_enque(), signal_ignored(), signm2signo(), SYM2ID, T_FIXNUM, T_STRING, T_SYMBOL, TYPE, and UNLIMITED_ARGUMENTS.
Definition at line 85 of file vm_method.c.
References rb_notimplement(), and UNREACHABLE.
Definition at line 815 of file load.c.
References rb_require_safe(), and rb_safe_level.
Definition at line 415 of file sprintf.c.
References GETNTHARG, and rb_str_format().
Definition at line 656 of file variable.c.
References ALLOC, trace_var::data, trace_var::func, global_entry, trace_var::next, NIL_P, OBJ_TAINTED, Qnil, rb_block_proc(), rb_eSecurityError, rb_f_untrace_var(), rb_global_entry(), rb_raise(), rb_scan_args(), rb_to_id(), rb_trace_eval(), and trace_var::removed.
Definition at line 715 of file variable.c.
References trace_var::data, global_entry, id, trace_var::next, NIL_P, PRIsVALUE, Qnil, QUOTE, QUOTE_ID, rb_ary_new(), rb_ary_new3, rb_ary_push(), rb_check_id(), rb_name_error(), rb_name_error_str(), rb_scan_args(), remove_trace(), trace_var::removed, st_data_t, and st_lookup().
| void rb_fd_fix_cloexec | ( | int | fd | ) |
Definition at line 221 of file io.c.
References rb_maygvl_fd_fix_cloexec(), and rb_update_max_fd().
Definition at line 529 of file load.c.
References FALSE, IS_DLEXT, IS_RBEXT, IS_SOEXT, Qnil, rb_feature_p(), rb_file_expand_path_fast(), rb_get_path(), rb_str_new2, RSTRING_PTR, strchr(), strrchr(), and TRUE.
Definition at line 1524 of file cont.c.
References GetFiberPtr, Qfalse, Qtrue, rb_fiber_struct::status, and TERMINATED.
Referenced by get_next_values(), and ruby_Init_Fiber_as_Coroutine().
| VALUE rb_fiber_current | ( | void | ) |
Definition at line 1332 of file cont.c.
References rb_fiber_struct::cont, rb_thread_struct::fiber, GET_THREAD(), rb_thread_struct::root_fiber, root_fiber_alloc(), and rb_context_struct::self.
Referenced by fiber_link_join(), fiber_switch(), get_next_values(), next_init(), rb_fiber_s_current(), and return_fiber().
Definition at line 1223 of file cont.c.
References fiber_alloc(), fiber_init(), func, rb_cFiber, and rb_proc_new().
Referenced by next_init().
| void rb_fiber_reset_root_local_storage | ( | VALUE | ) |
Definition at line 1502 of file cont.c.
References rb_fiber_struct::cont, rb_thread_struct::fiber, GetFiberPtr, GetThreadPtr, rb_thread_struct::local_storage, rb_thread_struct::root_fiber, and rb_context_struct::saved_thread.
Referenced by ruby_vm_destruct().
Definition at line 1480 of file cont.c.
References rb_fiber_struct::cont, fiber_switch(), GetFiberPtr, rb_fiber_struct::prev, Qnil, rb_eFiberError, rb_raise(), ROOT_FIBER_CONTEXT, rb_fiber_struct::transfered, and rb_context_struct::type.
Referenced by get_next_values(), and rb_fiber_m_resume().
Definition at line 1496 of file cont.c.
References rb_fiber_transfer(), and return_fiber().
Referenced by next_i(), next_ii(), and rb_fiber_s_yield().
Definition at line 3475 of file file.c.
References check_expand_path_args, expand_path, and EXPAND_PATH_BUFFER.
Definition at line 5275 of file file.c.
References rb_define_const().
Definition at line 3910 of file file.c.
References FilePathStringValue, isdirsep, name, OBJ_INFECT, rb_enc_copy(), rb_enc_get(), rb_str_cat(), rb_str_new(), rb_usascii_str_new2, skipprefix, skiproot(), StringValueCStr, strrdirsep, and top.
Definition at line 3421 of file file.c.
References check_expand_path_args, expand_path, and EXPAND_PATH_BUFFER.
Definition at line 3428 of file file.c.
References expand_path, and EXPAND_PATH_BUFFER.
Definition at line 3054 of file file.c.
References ALLOCA_N, ALLOCV_END, ALLOCV_N, append_fspath(), buf, BUFCHECK, BUFINIT, chompdirsep(), code_page(), convert_mb_to_wchar(), ENC_CODERANGE_7BIT, ENC_CODERANGE_CLEAR, fix_string_encoding, get_user_from_path(), home_dir(), Inc, INVALID_CODE_PAGE, IS_DIR_SEPARATOR_P, IS_DIR_UNC_P, isdirsep, istrailinggarbage, lstat, MAXPATHLEN, my_getcwd, nextdirsep, NIL_P, NULL, OBJ_TAINT, OBJ_TAINTED, PATH_BUFFER_SIZE, PRIsVALUE, Qnil, rb_default_home_dir(), rb_eArgError, rb_enc_associate(), rb_enc_check(), rb_enc_copy(), rb_enc_from_encoding(), rb_enc_get(), rb_enc_raise(), rb_enc_str_asciionly_p(), rb_enc_str_coderange(), rb_file_expand_path_internal(), rb_filesystem_encoding(), rb_home_dir_of(), rb_is_absolute_path(), rb_raise(), rb_str_buf_cat(), rb_str_encode(), rb_str_encode_ospath(), rb_str_modify(), rb_str_resize(), rb_str_set_len(), rb_utf8_encoding(), remove_invalid_alternative_data(), replace_to_long_name(), replace_wchar(), result, RSTRING_LEN, RSTRING_PTR, S_ISLNK, size, skipprefix, skiproot(), stat, STRCASECMP, StringValuePtr, strlcat(), strlen(), strncasecmp, strrdirsep, system_code_page(), TOLOWER, xfree, and xmalloc.
| int rb_file_load_ok | ( | const char * | ) |
Definition at line 5391 of file file.c.
References PepperInstance::as_int, PepperInstance::async_call_args, PepperInstance::async_call_result, PepperInstance::cond, convert_mb_to_wchar(), core_interface, fstat, GET_PEPPER_INSTANCE, PepperInstance::instance, INVALID_FILE_ATTRIBUTES, load_ok_internal(), PepperInstance::mutex, NULL, pruby_file_fetch_check_response(), rb_cloexec_open(), rb_update_max_fd(), S_ISREG, stat, and xfree.
Definition at line 5561 of file io.c.
References io_alloc(), rb_cFile, rb_file_open_internal(), and rb_str_new_cstr().
Definition at line 5554 of file io.c.
References FilePathValue, io_alloc(), rb_cFile, and rb_file_open_internal().
Definition at line 3495 of file file.c.
References Qnil, rb_file_absolute_path(), and rb_scan_args().
Definition at line 3462 of file file.c.
References Qnil, rb_file_expand_path(), and rb_scan_args().
| int rb_filesystem_encindex | ( | void | ) |
Definition at line 1300 of file encoding.c.
References rb_enc_registered().
Referenced by rb_filesystem_encoding().
| rb_encoding* rb_filesystem_encoding | ( | void | ) |
Definition at line 1309 of file encoding.c.
References rb_enc_from_index(), and rb_filesystem_encindex().
Referenced by copy_home_path(), dir_initialize(), env_fetch(), etc_systmpdir(), file_path_convert(), push_glob(), rb_dir_getwd(), rb_f_getenv(), rb_file_expand_path_internal(), rb_filesystem_str_new(), rb_filesystem_str_new_cstr(), rb_str_encode_ospath(), and rb_w32_special_folder().
Definition at line 731 of file string.c.
References rb_external_str_new_with_enc(), and rb_filesystem_encoding().
Definition at line 737 of file string.c.
References rb_external_str_new_with_enc(), rb_filesystem_encoding(), and strlen().
| rb_encoding* rb_find_encoding | ( | VALUE | ) |
Definition at line 226 of file encoding.c.
References enc_check_encoding(), NULL, rb_enc_from_index(), RDATA, and str_find_encindex().
Referenced by find_encoding().
Definition at line 5499 of file file.c.
References rb_find_file_safe(), and rb_safe_level.
Definition at line 5428 of file file.c.
References rb_find_file_ext_safe(), and rb_safe_level.
Definition at line 5434 of file file.c.
References copy_path_class(), file_expand_path_1(), FL_TAINT, FL_UNSET, fpath_check, is_explicit_relative(), MAXPATHLEN, OBJ_TAINTED, RARRAY_AREF, RARRAY_LEN, rb_enc_associate_index(), rb_eSecurityError, rb_file_expand_path_internal(), rb_file_load_ok(), RB_GC_GUARD, rb_get_expanded_load_path(), rb_get_path_check(), rb_is_absolute_path(), rb_raise(), rb_str_cat2(), rb_str_dup(), rb_str_set_len(), rb_str_tmp_new(), rb_usascii_encindex, RBASIC_CLEAR_CLASS, RSTRING_PTR, and StringValueCStr.
Definition at line 5505 of file file.c.
References copy_path_class(), file_expand_path_1(), fpath_check, is_explicit_relative(), MAXPATHLEN, OBJ_TAINTED, RARRAY_AREF, RARRAY_LEN, rb_enc_associate_index(), rb_eSecurityError, rb_file_expand_path_internal(), rb_file_load_ok(), RB_GC_GUARD, rb_get_expanded_load_path(), rb_get_path_check(), rb_is_absolute_path(), rb_raise(), rb_str_tmp_new(), rb_usascii_encindex, RSTRING_PTR, and StringValueCStr.
| short rb_fix2short | ( | VALUE | ) |
Definition at line 2240 of file numeric.c.
References check_short(), FIX2LONG, FIXNUM_P, and rb_num2long().
Definition at line 2644 of file numeric.c.
References buf, CHAR_BIT, FIX2LONG, neg, rb_eArgError, rb_raise(), rb_usascii_str_new2, ruby_digitmap, and SIZEOF_VALUE.
| unsigned short rb_fix2ushort | ( | VALUE | ) |
Definition at line 2259 of file numeric.c.
References check_ushort(), FIX2ULONG, FIXNUM_P, negative_int_p(), and rb_num2ushort().
Definition at line 2896 of file object.c.
References DBL2NUM, FIX2LONG, rb_big2dbl(), rb_convert_type(), rb_eTypeError, rb_raise(), rb_str_to_dbl(), T_BIGNUM, T_FIXNUM, T_FLOAT, T_NIL, T_STRING, TRUE, TYPE, and UNREACHABLE.
| VALUE rb_float_new | ( | double | ) |
Definition at line 4115 of file numeric.c.
References rb_float_new, and rb_float_new_inline().
| VALUE rb_float_new_in_heap | ( | double | ) |
Definition at line 637 of file numeric.c.
References FL_WB_PROTECTED, NEWOBJ_OF, OBJ_FREEZE, rb_cFloat, RGENGC_WB_PROTECTED_FLOAT, and T_FLOAT.
|
inlinestatic |
Definition at line 565 of file internal.h.
References rb_float_new_in_heap(), and RUBY_BIT_ROTL.
| double rb_float_value | ( | VALUE | ) |
Definition at line 4108 of file numeric.c.
References rb_float_value, and rb_float_value_inline().
|
inlinestatic |
Definition at line 539 of file internal.h.
References FLONUM_P, and RUBY_BIT_ROTR.
Definition at line 2036 of file rational.c.
References f, f_add(), f_eqeq_p(), f_expt, f_lshift, f_mul, f_positive_p, f_sub(), f_to_r, f_zero_p(), float_decode_internal(), FLT_RADIX, INT2FIX, nurat_rationalize_internal(), ONE, rb_rational_new1, rb_rational_new2, and TWO.
Definition at line 2020 of file rational.c.
References f_abs, f_add(), f_eqeq_p(), f_sub(), f_to_r, nurat_rationalize_internal(), and rb_rational_new2.
| rb_pid_t rb_fork_async_signal_safe | ( | int * | status, |
| int(*)(void *, char *, size_t) | chfunc, | ||
| void * | charg, | ||
| VALUE | fds, | ||
| char * | errmsg, | ||
| size_t | errmsg_buflen | ||
| ) |
| rb_pid_t rb_fork_ruby | ( | int * | status | ) |
| ID rb_frame_callee | ( | void | ) |
Definition at line 949 of file eval.c.
References frame_called_id(), and GET_THREAD().
Referenced by error_pos(), rb_insecure_operation(), rb_secure(), set_const_visibility(), and set_method_visibility().
Definition at line 1667 of file vm.c.
References GET_THREAD(), and rb_thread_method_id_and_class().
| ID rb_frame_this_func | ( | void | ) |
Definition at line 943 of file eval.c.
References frame_func_id(), and GET_THREAD().
Referenced by argf_forward(), lazy_set_method(), rb_iterate(), rb_notimplement(), rb_struct_ref(), rb_struct_set(), recursive_list_access(), and recursive_pop().
| void rb_free_generic_ivar | ( | VALUE | ) |
Definition at line 1030 of file variable.c.
References key, st_data_t, st_delete(), and st_free_table().
| void rb_free_tmp_buffer | ( | volatile VALUE * | store | ) |
Definition at line 933 of file string.c.
References rb_str_clear().
| void rb_frozen_class_p | ( | VALUE | ) |
Definition at line 406 of file eval.c.
References BUILTIN_TYPE, Check_Type, FL_SINGLETON, FL_TEST, OBJ_FROZEN, rb_error_frozen(), SPECIAL_CONST_P, T_CLASS, T_ICLASS, and T_MODULE.
Referenced by rb_alias(), rb_include_module(), rb_prepend_module(), and rb_undef().
Definition at line 201 of file string.c.
References Check_Type, FL_TEST, fstr_update_callback(), Qnil, RSTRING_FSTR, st_data_t, st_init_table(), st_update(), and T_STRING.
Calls a method.
| recv | receiver of the method |
| mid | an ID that represents the name of the method |
| n | the number of arguments |
| ... | arbitrary number of method arguments |
Definition at line 775 of file vm_eval.c.
References ALLOCA_N, argv, CALL_FCALL, rb_call(), and va_init_list.
Definition at line 827 of file vm_eval.c.
References CALL_PUBLIC, GET_THREAD(), PASS_PASSED_BLOCK_TH, and rb_call().
Definition at line 835 of file vm_eval.c.
References rb_proc_t::block, CALL_PUBLIC, GET_THREAD(), GetProcPtr, NIL_P, rb_thread_struct::passed_block, and rb_call().
Calls a method.
| recv | receiver of the method |
| mid | an ID that represents the name of the method |
| argc | the number of arguments |
| argv | pointer to an array of method arguments |
Definition at line 806 of file vm_eval.c.
References CALL_FCALL, and rb_call().
Calls a method.
Same as rb_funcall2 but this function can call only public methods.
| recv | receiver of the method |
| mid | an ID that represents the name of the method |
| argc | the number of arguments |
| argv | pointer to an array of method arguments |
Definition at line 821 of file vm_eval.c.
References CALL_PUBLIC, and rb_call().
| void rb_gc | ( | void | ) |
Definition at line 5190 of file gc.c.
References finalize_deferred(), finalizing, garbage_collect(), GPR_FLAG_CAPI, rb_objspace, and TRUE.
| void rb_gc_call_finalizer_at_exit | ( | void | ) |
Definition at line 2144 of file gc.c.
References rb_objspace_call_finalizer().
Definition at line 1998 of file gc.c.
References finalizer_table, FL_FINALIZE, FL_SET, FL_TEST, rb_objspace, st_data_t, st_insert(), and st_lookup().
| size_t rb_gc_count | ( | void | ) |
Definition at line 5219 of file gc.c.
References rb_objspace::count, and rb_objspace::profile.
| VALUE rb_gc_disable | ( | void | ) |
Definition at line 5638 of file gc.c.
References dont_gc, gc_rest_sweep(), Qfalse, Qtrue, rb_objspace, and TRUE.
| VALUE rb_gc_enable | ( | void | ) |
| void rb_gc_finalize_deferred | ( | void | ) |
Definition at line 2112 of file gc.c.
References gc_finalize_deferred().
| void rb_gc_force_recycle | ( | VALUE | ) |
Definition at line 4897 of file gc.c.
References heap_page::before_sweep, CLEAR_IN_BITMAP, GET_HEAP_MARK_BITS, GET_HEAP_OLDGEN_BITS, GET_HEAP_PAGE, GET_HEAP_REMEMBERSET_BITS, heap_page_add_freeobj(), rb_objspace::profile, rb_objspace, and rb_objspace::total_freed_object_num.
Definition at line 5318 of file gc.c.
References gc_info_decode(), rb_objspace::latest_gc_info, rb_objspace::profile, and rb_objspace.
| void rb_gc_mark_encodings | ( | void | ) |
Definition at line 236 of file encoding.c.
Referenced by gc_mark_roots().
| void rb_gc_mark_global_tbl | ( | void | ) |
Definition at line 562 of file variable.c.
References mark_global_entry(), and st_foreach_safe().
Definition at line 3311 of file gc.c.
References gc_mark_locations().
| void rb_gc_mark_maybe | ( | VALUE | ) |
Definition at line 3537 of file gc.c.
References gc_mark_maybe().
| void rb_gc_mark_parser | ( | void | ) |
Definition at line 16604 of file ripper.c.
Referenced by gc_mark_roots().
| void rb_gc_mark_symbols | ( | int | full_mark | ) |
Definition at line 16776 of file ripper.c.
References global_symbols, symbols::id_str, symbols::minor_marked, numberof, symbols::op_sym, rb_gc_mark_locations, and rb_mark_tbl().
Referenced by gc_mark_roots().
| void rb_gc_register_address | ( | VALUE * | ) |
Definition at line 4927 of file gc.c.
References ALLOC, global_List, gc_list::next, rb_objspace, and gc_list::varptr.
| void rb_gc_register_mark_object | ( | VALUE | ) |
Definition at line 4920 of file gc.c.
References GET_THREAD(), rb_vm_struct::mark_object_ary, rb_ary_push(), and rb_thread_struct::vm.
| void rb_gc_resurrect | ( | VALUE | ptr | ) |
Definition at line 3612 of file gc.c.
References gc_mark_ptr(), gc_marked(), heap_eden, is_lazy_sweeping, is_swept_object(), and rb_objspace.
| size_t rb_gc_stat | ( | VALUE | ) |
Definition at line 5555 of file gc.c.
References gc_stat_internal(), and SYMBOL_P.
| void rb_gc_unregister_address | ( | VALUE * | ) |
Definition at line 4939 of file gc.c.
References global_List, gc_list::next, rb_objspace, gc_list::varptr, and xfree.
Definition at line 4731 of file gc.c.
References obj_type_name(), rb_bug(), rb_objspace, RGENGC_CHECK_MODE, rgengc_remember(), rgengc_remembered(), rgengc_report, RVALUE_OLD_BITMAP_P(), RVALUE_OLD_P(), and RVALUE_PROMOTED_P().
| void rb_gc_writebarrier_remember_promoted | ( | VALUE | obj | ) |
Definition at line 4782 of file gc.c.
References rb_objspace, and rgengc_remember().
| void rb_gc_writebarrier_unprotect_promoted | ( | VALUE | obj | ) |
Definition at line 4749 of file gc.c.
References BUILTIN_TYPE, obj_type_name(), rb_objspace::profile, rb_bug(), rb_objspace, rb_objspace::remembered_shady_object_count, rb_objspace::rgengc, RGENGC_CHECK_MODE, rgengc_remember(), rgengc_remembered(), rgengc_report, RVALUE_DEMOTE_FROM_OLD(), RVALUE_OLD_P(), RVALUE_PROMOTED_P(), and RVALUE_WB_PROTECTED.
Definition at line 356 of file rational.c.
References f_gcd_normal().
Definition at line 907 of file variable.c.
References FL_EXIVAR, FL_TEST, st_data_t, and st_lookup().
| unsigned int rb_genrand_int32 | ( | void | ) |
Definition at line 251 of file random.c.
References default_mt(), and genrand_int32().
| double rb_genrand_real | ( | void | ) |
Definition at line 258 of file random.c.
References default_mt(), and genrand_real().
| unsigned long rb_genrand_ulong_limited | ( | unsigned long | i | ) |
Definition at line 789 of file random.c.
References default_mt(), and limited_rand().
| rb_alloc_func_t rb_get_alloc_func | ( | VALUE | ) |
Definition at line 524 of file vm_method.c.
References Check_Type, RCLASS_EXT, RCLASS_SUPER, T_CLASS, and UNDEF_ALLOC_FUNC.
Definition at line 55 of file eval_error.c.
References get_backtrace().
Referenced by eval_string_with_cref().
| VALUE rb_get_expanded_load_path | ( | void | ) |
Definition at line 109 of file load.c.
References EXPAND_ALL, EXPAND_HOME, EXPAND_NON_CACHE, EXPAND_RELATIVE, rb_vm_struct::expanded_load_path, GET_VM, rb_vm_struct::load_path, rb_vm_struct::load_path_check_cache, load_path_getcwd(), rb_vm_struct::load_path_snapshot, Qtrue, rb_ary_shared_with_p(), rb_construct_expanded_load_path(), and rb_str_equal().
| int rb_get_next_signal | ( | void | ) |
Definition at line 675 of file signal.c.
References ATOMIC_DEC, RUBY_NSIG, and signal_buff.
Definition at line 225 of file file.c.
References rb_get_path_check(), and rb_safe_level.
Definition at line 198 of file file.c.
References check_path_encoding(), file_path_convert(), insecure_obj_p, rb_insecure_operation(), rb_str_new4, and StringValueCStr.
Definition at line 176 of file file.c.
References CONST_ID, insecure_obj_p, Qundef, rb_check_funcall(), rb_insecure_operation(), RB_TYPE_P, StringValue, and T_STRING.
Definition at line 219 of file file.c.
References rb_get_path_check().
Definition at line 2717 of file array.c.
References argc, FIX2LONG, FIXNUM_P, func, NUM2LONG, RARRAY_LEN, rb_ary_new2, rb_ary_push(), rb_ary_resize(), rb_range_beg_len(), and result.
Referenced by match_values_at(), rb_ary_values_at(), and rb_struct_values_at().
| VALUE rb_gets | ( | void | ) |
Definition at line 8014 of file io.c.
References ARGF, next_argv, NIL_P, Qnil, rb_default_rs, rb_f_gets(), rb_io_close(), rb_io_gets(), rb_lastline_set(), and rb_rs.
Definition at line 1615 of file dir.c.
References func, GLOB_JUMP_TAG, rb_ascii8bit_encoding(), and rb_glob2().
|
read |
Definition at line 450 of file variable.c.
References ALLOC, global_variable::block_trace, global_variable::counter, global_variable::data, global_variable::getter, global_entry, id, global_variable::marker, global_variable::setter, st_add_direct(), st_data_t, st_lookup(), global_variable::trace, undef_getter, undef_marker, and undef_setter.
| void rb_global_variable | ( | VALUE * | ) |
Definition at line 4962 of file gc.c.
References rb_gc_register_address().
Definition at line 819 of file variable.c.
References global_entry, global_id(), rb_global_entry(), and rb_gvar_get().
Definition at line 810 of file variable.c.
References global_entry, global_id(), rb_global_entry(), and rb_gvar_set().
| VALUE rb_gvar_defined | ( | struct rb_global_entry * | ) |
| VALUE rb_gvar_get | ( | struct rb_global_entry * | ) |
| void rb_gvar_readonly_setter | ( | VALUE | val, |
| ID | id, | ||
| void * | data, | ||
| struct rb_global_variable * | gvar | ||
| ) |
| VALUE rb_gvar_set | ( | struct rb_global_entry * | , |
| VALUE | |||
| ) |
| VALUE rb_gvar_undef_getter | ( | ID | id, |
| void * | data, | ||
| struct rb_global_variable * | gvar | ||
| ) |
| void rb_gvar_undef_marker | ( | VALUE * | var | ) |
| void rb_gvar_undef_setter | ( | VALUE | val, |
| ID | id, | ||
| void * | data, | ||
| struct rb_global_variable * | gvar | ||
| ) |
| VALUE rb_gvar_val_getter | ( | ID | id, |
| void * | data, | ||
| struct rb_global_variable * | gvar | ||
| ) |
| void rb_gvar_val_marker | ( | VALUE * | var | ) |
| void rb_gvar_val_setter | ( | VALUE | val, |
| ID | id, | ||
| void * | data, | ||
| struct rb_global_variable * | gvar | ||
| ) |
| VALUE rb_gvar_var_getter | ( | ID | id, |
| void * | data, | ||
| struct rb_global_variable * | gvar | ||
| ) |
| void rb_gvar_var_marker | ( | VALUE * | var | ) |
| void rb_gvar_var_setter | ( | VALUE | val, |
| ID | id, | ||
| void * | data, | ||
| struct rb_global_variable * | gvar | ||
| ) |
Definition at line 106 of file hash.c.
References CHAR_BIT, FIXNUM_P, hash_recursive(), INTEGER_PACK_NATIVE_BYTE_ORDER, LONG2FIX, rb_exec_recursive_outer(), rb_integer_pack(), rb_to_int(), RB_TYPE_P, and T_BIGNUM.
Definition at line 3046 of file object.c.
References NIL_P, RARRAY_LEN, rb_check_hash_type(), rb_eTypeError, rb_hash_new(), rb_obj_classname(), rb_raise(), RB_TYPE_P, and T_ARRAY.
Definition at line 697 of file hash.c.
References hash_default_value(), RHASH, st_data_t, st_lookup(), and val.
Definition at line 1393 of file hash.c.
References hash_aset(), hash_aset_str(), hash_tbl(), identhash, no_new_key(), rb_cString, rb_hash_modify(), rb_obj_class(), RHASH, RHASH_ITER_LEV, RHASH_UPDATE_ITER, st_table::type, and shift_var::val.
Definition at line 1324 of file hash.c.
References clear_i(), hash(), rb_hash_foreach(), rb_hash_modify_check(), RHASH, RHASH_ITER_LEV, and st_clear().
Definition at line 996 of file hash.c.
References Qnil, Qundef, rb_block_given_p(), rb_hash_delete_key(), rb_hash_modify_check(), rb_yield(), and val.
Definition at line 1094 of file hash.c.
References delete_if_i(), hash(), hash_enum_size(), rb_hash_foreach(), rb_hash_modify_check(), RETURN_SIZED_ENUMERATOR, and RHASH.
Definition at line 320 of file hash.c.
References rb_hash_dup_empty(), RHASH, RHASH_EMPTY_P, and st_copy().
| st_index_t rb_hash_end | ( | st_index_t | ) |
Definition at line 782 of file hash.c.
References rb_hash_fetch_m().
Definition at line 264 of file hash.c.
References hash_foreach_arg::arg, func, hash_foreach_arg::func, hash(), hash_foreach_arg::hash, hash_foreach_call(), hash_foreach_ensure(), rb_ensure(), RHASH, and RHASH_ITER_LEV.
Definition at line 62 of file hash.c.
References rb_obj_freeze().
Definition at line 1783 of file hash.c.
References keys_i(), OBJ_PROMOTED, Qundef, RARRAY_PTR_USE, rb_ary_new_capa(), rb_ary_set_len(), rb_gc_writebarrier_remember_promoted(), rb_hash_foreach(), RHASH, RHASH_SIZE, size, ST_DATA_COMPATIBLE_P, and st_keys_check().
Definition at line 719 of file hash.c.
References Qnil, and rb_hash_lookup2().
| VALUE rb_hash_new | ( | void | ) |
Definition at line 298 of file hash.c.
References hash_alloc(), and rb_cHash.
| st_index_t rb_hash_proc | ( | st_index_t | hash, |
| VALUE | proc | ||
| ) |
Definition at line 995 of file proc.c.
References rb_proc_t::block, rb_proc_t::envval, rb_block_struct::ep, GetProcPtr, rb_block_struct::iseq, and rb_hash_uint.
Definition at line 73 of file hash.c.
References hash(), RB_OBJ_WRITE, and RHASH.
| st_index_t rb_hash_start | ( | st_index_t | ) |
Definition at line 1296 of file random.c.
References hashseed, and st_hash_start.
Definition at line 344 of file hash.c.
References hash_tbl(), and OBJ_WB_UNPROTECT.
Definition at line 351 of file hash.c.
References hash_tbl().
| st_index_t rb_hash_uint | ( | st_index_t | , |
| st_index_t | |||
| ) |
| st_index_t rb_hash_uint32 | ( | st_index_t | , |
| uint32_t | |||
| ) |
| VALUE rb_hash_update_by | ( | VALUE | hash1, |
| VALUE | hash2, | ||
| rb_hash_update_func * | func | ||
| ) |
Definition at line 2208 of file hash.c.
References func, update_func_arg::func, update_func_arg::hash, rb_hash_foreach(), rb_hash_modify(), rb_hash_update_func_i(), rb_hash_update_i(), and to_hash().
Definition at line 1827 of file hash.c.
References OBJ_PROMOTED, Qundef, RARRAY_PTR_USE, rb_ary_new_capa(), rb_ary_set_len(), rb_gc_writebarrier_remember_promoted(), rb_hash_foreach(), RHASH, RHASH_SIZE, size, ST_DATA_COMPATIBLE_P, st_values_check(), and values_i().
Definition at line 3001 of file file.c.
References copy_home_path(), PRIsVALUE, rb_eArgError, rb_raise(), result, and RSTRING_PTR.
Definition at line 17227 of file ripper.c.
References rb_id2str(), and RSTRING_PTR.
Referenced by add_opt_method(), addrinfo_inspect(), assignable_gen(), check_dump_arg(), check_exec_redirect(), check_load_arg(), chunk_ii(), control_frame_dump(), dump_object(), econv_opts(), error_pos(), esignal_init(), extract_user_token(), fole_missing(), get_eval_string_core(), gettable_gen(), id2ref(), insn_data_to_s_detail(), inspect_i(), iow_inspect(), iseq_compile_each(), match_backref_number(), mnew_from_me(), must_respond_to(), new_bv_gen(), num_sadded(), object_allocations_reporter_i(), ossl_pkcs7_sym2typeid(), ossl_sslctx_set_ssl_version(), r_object0(), racc_yyparse(), rb_define_class_id_under(), rb_dlcfunc_call(), rb_execarg_addopt(), rb_f_kill(), rb_f_local_variables(), rb_id_attrset(), rb_insecure_operation(), rb_insn_operand_intern(), rb_method_call_status(), rb_method_entry_make(), rb_notimplement(), rb_search_method_entry(), rb_secure(), rb_str_format(), rb_str_setter(), rb_struct_aref_id(), rb_struct_aset_id(), rb_thread_current_status(), rb_undef(), reg_named_capture_assign_iter(), remove_method(), rsock_inspect_sockaddr(), rsock_revlookup_flag(), ruby_debug_print_id(), shadowing_lvar_0(), sockopt_inspect(), strscan_aref(), symbol2event_flag(), trap_signm(), validate_label(), vm_call_method(), vm_getivar(), void_expr_gen(), vtable_add(), and warn_unused_var().
Definition at line 17157 of file ripper.c.
References global_symbols, ID_CLASS, ID_CONST, ID_GLOBAL, ID_INSTANCE, ID_JUNK, ID_LOCAL, symbols::id_str, is_attrset_id, symbols::minor_marked, OBJ_FREEZE, symbols::op_sym, op_tbl, op_tbl_count, rb_cString, rb_fstring(), rb_id2str(), rb_ispunct(), rb_str_cat(), rb_str_dup(), rb_usascii_str_new(), rb_usascii_str_new2, RBASIC, RBASIC_SET_CLASS_RAW, register_symid_str(), st_data_t, st_lookup(), tLAST_TOKEN, and token.
Referenced by add_id(), addrinfo_mdump(), append_method(), cbsubst_get_subst_arg(), cbsubst_sym_to_subst(), cbsubst_table_setup(), check_local_id(), classname(), fc_path(), gc_info_decode(), gc_stat_internal(), id_to_name(), inspect_struct(), intern_str(), is_private_local_id(), iseq_compile_each(), iseq_data_to_ary(), iseq_load(), location_label(), location_to_str(), match_aref(), method_inspect(), oldbt_iter_cfunc(), r_unique(), rb_attr(), rb_define_class_id_under(), rb_define_module_id_under(), rb_enc_get_index(), rb_id2name(), rb_id2str(), rb_id_quote_unprintable(), rb_insn_operand_intern(), rb_iseq_parameters(), rb_method_entry_make(), rb_sym_to_s(), rsock_ipaddr(), sym_capitalize(), sym_downcase(), sym_empty(), sym_encoding(), sym_inspect(), sym_length(), sym_swapcase(), sym_upcase(), trap_handler(), vm_stat(), and w_symbol().
Definition at line 15419 of file ripper.c.
References id, ID2SYM, ID_ATTRSET, ID_CLASS, ID_CONST, ID_GLOBAL, ID_INSTANCE, ID_JUNK, ID_LOCAL, is_notop_id, PRIsVALUE, rb_id2name(), rb_name_error(), tAREF, and tASET.
Referenced by attrset_gen(), intern_str(), rb_attr(), rb_check_id(), rb_check_id_cstr(), rb_struct_set(), and setup_struct().
| ID rb_id_encoding | ( | void | ) |
Definition at line 732 of file encoding.c.
References CONST_ID, and id_encoding.
Referenced by enc_set_index(), id2encidx(), rb_enc_get_index(), w_encoding(), and w_obj_each().
Definition at line 8421 of file string.c.
References rb_id2str(), and rb_str_quote_unprintable().
| VALUE rb_insns_name_array | ( | void | ) |
Definition at line 5546 of file compile.c.
References numberof, rb_ary_new(), rb_ary_push(), rb_fstring(), rb_obj_freeze(), and rb_str_new2.
Referenced by Init_VM().
Definition at line 471 of file object.c.
References id_inspect, rb_default_external_encoding(), rb_eEncCompatError, rb_enc_asciicompat, rb_enc_get(), rb_enc_str_asciionly_p(), rb_funcall(), rb_obj_as_string(), and rb_raise().
| VALUE rb_int2big | ( | SIGNED_VALUE | ) |
Definition at line 3164 of file bignum.c.
References neg, rb_uint2big(), and RBIGNUM_SET_SIGN.
Referenced by bigdivmod(), bigdivrem(), f_imul(), fix_cmp(), fix_divide(), fix_divmod(), fix_fdiv(), fix_ge(), fix_gt(), fix_le(), fix_lshift(), fix_lt(), fix_minus(), fix_mod(), fix_mul(), fix_pow(), int_pow(), rb_big_cmp(), rb_big_coerce(), rb_big_divide(), rb_big_divmod(), rb_big_eq(), rb_big_fdiv(), rb_big_modulo(), rb_big_mul(), rb_big_remainder(), rb_fix_lshift(), rb_fix_rshift(), rb_int2inum(), rb_int2num_inline(), rb_long2num_inline(), and w_object().
| VALUE rb_int2inum | ( | SIGNED_VALUE | ) |
Definition at line 3192 of file bignum.c.
References FIXABLE, LONG2FIX, and rb_int2big().
Referenced by gzfile_reader_rewind().
|
inlinestatic |
Definition at line 1281 of file ruby.h.
References FIXABLE, INT2FIX, and rb_int2big().
| VALUE rb_int_positive_pow | ( | long | x, |
| unsigned long | y | ||
| ) |
Definition at line 2499 of file numeric.c.
References FIX2LONG, FIXNUM_P, INT2FIX, LONG2NUM, rb_big_minus(), rb_funcall(), RB_TYPE_P, and T_BIGNUM.
Definition at line 2474 of file numeric.c.
References FIX2LONG, FIXNUM_P, INT2FIX, LONG2NUM, rb_big_plus(), rb_funcall(), RB_TYPE_P, and T_BIGNUM.
Definition at line 2737 of file object.c.
References rb_convert_to_integer().
Definition at line 5297 of file bignum.c.
References FIX2LONG, FIXNUM_MAX, FIXNUM_MIN, FIXNUM_P, INT2FIX, isinf(), isnan, Qnil, rb_big_cmp(), rb_dbl2big(), and RFLOAT_VALUE.
Referenced by big_op(), fix_cmp(), fix_ge(), fix_gt(), fix_le(), fix_lt(), flo_cmp(), flo_ge(), flo_gt(), flo_le(), flo_lt(), and rb_big_cmp().
Definition at line 5347 of file bignum.c.
References FIX2LONG, FIXNUM_P, isinf(), isnan, LONG_MAX, LONG_MIN, Qfalse, Qtrue, rb_big_eq(), rb_dbl2big(), and RFLOAT_VALUE.
Referenced by fix_equal(), flo_eq(), and rb_big_eq().
| int rb_integer_pack | ( | VALUE | val, |
| void * | words, | ||
| size_t | numwords, | ||
| size_t | wordsize, | ||
| size_t | nails, | ||
| int | flags | ||
| ) |
Definition at line 3529 of file bignum.c.
References bary_pack(), BDIGIT, bdigit_roomof, BDIGITS, BIGDN, BIGLO, FIX2LONG, FIXNUM_P, numberof, RB_GC_GUARD, rb_to_int(), RBIGNUM_LEN, and RBIGNUM_POSITIVE_P.
Referenced by big2str_base_poweroftwo(), big_shift2(), int_pair_to_real_inclusive(), limited_big_rand(), rand_init(), random_load(), rb_big2ulong_pack(), rb_big_pack(), rb_hash(), rb_quad_pack(), and rb_str_format().
| VALUE rb_integer_unpack | ( | const void * | words, |
| size_t | numwords, | ||
| size_t | wordsize, | ||
| size_t | nails, | ||
| int | flags | ||
| ) |
Definition at line 3615 of file bignum.c.
References bary_unpack_internal(), bary_zero_p(), BDIGIT, BDIGIT_DBL, BDIGIT_DBL_SIGNED, BDIGIT_MSB, BDIGITS, big_extend_carry(), bignew, bignorm(), bigtrunc(), BIGUP, INTEGER_PACK_2COMP, INTEGER_PACK_FORCE_BIGNUM, INTEGER_PACK_FORCE_GENERIC_IMPLEMENTATION, INTEGER_PACK_LSBYTE_FIRST, INTEGER_PACK_LSWORD_FIRST, INTEGER_PACK_MSBYTE_FIRST, INTEGER_PACK_MSWORD_FIRST, INTEGER_PACK_NATIVE_BYTE_ORDER, INTEGER_PACK_NEGATIVE, integer_unpack_num_bdigits(), LONG2FIX, LONG_MAX, MEMCPY, NEGFIXABLE, numberof, POSFIXABLE, Qfalse, rb_eArgError, rb_raise(), RBIGNUM_LEN, RBIGNUM_SET_SIGN, val, and validate_integer_pack_format().
Referenced by int_pair_to_real_inclusive(), limited_big_rand(), make_seed_value(), mt_state(), pack_unpack(), r_object0(), rb_big_bit_length(), rb_big_unpack(), and rb_quad_unpack().
Definition at line 17141 of file ripper.c.
References rb_intern, rb_intern2(), and strlen().
Definition at line 17134 of file ripper.c.
References rb_intern3(), and rb_usascii_encoding().
Referenced by global_id(), init_constants(), Init_load(), rb_f_global_variables(), rb_intern(), and yyparse().
| ID rb_intern3 | ( | const char * | , |
| long | , | ||
| rb_encoding * | |||
| ) |
Definition at line 17005 of file ripper.c.
References global_symbols, intern_str(), OBJ_FREEZE, rb_enc_associate(), rb_enc_str_new(), setup_fake_str(), st_data_t, st_lookup(), and symbols::sym_id.
Referenced by intern_str(), parser_yylex(), rb_intern2(), and reg_named_capture_assign_iter().
Definition at line 17147 of file ripper.c.
References global_symbols, id, intern_str(), rb_str_dup(), st_data_t, st_lookup(), and symbols::sym_id.
| ID rb_interned_id_p | ( | const char * | , |
| long | , | ||
| rb_encoding * | |||
| ) |
| void rb_interrupt | ( | void | ) |
Definition at line 585 of file eval.c.
References rb_eInterrupt, and rb_raise().
Referenced by rb_signal_exec().
Definition at line 42 of file compar.c.
References INT2FIX, invcmp_recursive(), NIL_P, Qnil, Qundef, rb_cmpint(), rb_exec_recursive(), and result.
Referenced by rb_str_cmp_m(), and time_cmp().
Definition at line 1449 of file io.c.
References rb_io_write().
Definition at line 4725 of file io.c.
References GetOpenFile, and io_ascii8bit_binmode().
Definition at line 4679 of file io.c.
References ECONV_NEWLINE_DECORATOR_MASK, rb_io_t::fd, FMODE_BINMODE, FMODE_TEXTMODE, GetOpenFile, rb_io_t::mode, O_BINARY, rb_econv_binmode(), rb_io_t::readconv, SET_BINARY_MODE_WITH_SEEK_CUR, rb_io_t::writeconv, and rb_io_t::writeconv_pre_ecflags.
| ssize_t rb_io_bufread | ( | VALUE | io, |
| void * | buf, | ||
| size_t | size | ||
| ) |
Definition at line 2094 of file io.c.
References bufread_arg::fptr, GetOpenFile, io_bufread(), and rb_io_check_readable().
Definition at line 4292 of file io.c.
References FALSE, rb_io_t::fd, finish_writeconv_arg::fptr, GetWriteIO, rb_io_t::pid, Qnil, rb_io_fptr_cleanup(), rb_last_status_clear(), rb_syswait(), rb_thread_fd_close(), RFILE, and TRUE.
Definition at line 1745 of file io.c.
References rb_io_t::fd, binwrite_arg::fptr, GetOpenFile, io_fillbuf(), NEED_NEWLINE_DECORATOR_ON_READ, NEED_READCONV, Qfalse, Qtrue, rb_io_check_char_readable(), READ_CHAR_PENDING, READ_CHECK, and READ_DATA_PENDING.
Definition at line 1510 of file io.c.
References rb_io_flush_raw().
Definition at line 1466 of file io.c.
References rb_io_t::fd, FMODE_READABLE, FMODE_WRITABLE, binwrite_arg::fptr, GetOpenFile, GetWriteIO, id_flush, io_fflush(), io_unread(), rb_io_t::mode, rb_funcall(), rb_sys_fail(), rb_thread_io_blocking_region(), RB_TYPE_P, rb_w32_get_osfhandle(), and T_FILE.
Definition at line 3772 of file io.c.
References c, rb_io_t::fd, FMODE_TTY, GetOpenFile, INT2FIX, io_fillbuf(), rb_io_buffer_t::len, rb_io_t::mode, rb_io_buffer_t::off, rb_io_buffer_t::ptr, Qnil, rb_io_check_byte_readable(), rb_io_flush(), rb_stdout, RB_TYPE_P, rb_io_t::rbuf, READ_CHECK, and T_FILE.
Definition at line 3187 of file io.c.
References rb_default_rs, and rb_io_getline_1().
Definition at line 6818 of file io.c.
References argc, NIL_P, Qnil, rb_io_write(), rb_lastline_get(), rb_output_fs, and rb_output_rs.
Definition at line 6759 of file io.c.
References Qnil, rb_f_sprintf(), and rb_io_write().
Definition at line 6983 of file io.c.
References argc, io_puts_ary(), Qnil, rb_default_rs, rb_exec_recursive(), rb_io_write(), rb_obj_as_string(), RB_TYPE_P, RSTRING_LEN, str_end_with_asciichar(), and T_STRING.
Definition at line 3833 of file io.c.
References FIX2INT, FIXNUM_P, GetOpenFile, io_ungetbyte(), NIL_P, Qnil, rb_io_check_byte_readable(), rb_str_new(), and SafeStringValue.
Definition at line 3868 of file io.c.
References rb_io_buffer_t::capa, rb_io_t::cbuf, FIX2UINT, FIXNUM_P, GetOpenFile, io_read_encoding(), io_ungetbyte(), rb_io_buffer_t::len, read_internal_arg::len, make_readconv(), MEMMOVE, NEED_NEWLINE_DECORATOR_ON_READ_CHECK, NEED_READCONV, NIL_P, NUM2UINT, rb_io_buffer_t::off, rb_io_buffer_t::ptr, Qnil, rb_eIOError, rb_enc_uint_chr(), rb_io_check_char_readable(), rb_raise(), RB_TYPE_P, RSTRING_LEN, RSTRING_PTR, SafeStringValue, SET_BINARY_MODE, and T_BIGNUM.
Definition at line 1427 of file io.c.
References id_write, and rb_funcallv().
| int rb_is_absolute_path | ( | const char * | ) |
| int rb_is_attrset_id | ( | ID | ) |
Definition at line 17292 of file ripper.c.
References is_attrset_id.
| int rb_is_attrset_name | ( | VALUE | name | ) |
Definition at line 17410 of file ripper.c.
References ID_ATTRSET, IDSET_ATTRSET_FOR_INTERN, and rb_str_symname_type().
Referenced by rb_check_id(), and rb_check_id_cstr().
| int rb_is_class_id | ( | ID | ) |
Definition at line 17274 of file ripper.c.
References is_class_id.
Referenced by cv_i(), rb_cv_get(), rb_cv_set(), rb_define_class_variable(), rb_mod_cvar_defined(), rb_mod_cvar_get(), and rb_mod_remove_cvar().
| int rb_is_class_name | ( | VALUE | name | ) |
Definition at line 17392 of file ripper.c.
References ID_CLASS, and rb_str_symname_type().
Referenced by rb_mod_cvar_defined(), rb_mod_cvar_get(), and rb_mod_remove_cvar().
| int rb_is_const_id | ( | ID | ) |
Definition at line 17268 of file ripper.c.
References is_const_id.
Referenced by defined_expr(), fc_i(), inspect_struct(), iseq_compile_each(), ole_const_load(), rb_autoload(), rb_define_const(), rb_is_attr_id(), rb_mod_const_defined(), rb_mod_const_get(), rb_mod_remove_const(), and sv_i().
| int rb_is_const_name | ( | VALUE | name | ) |
Definition at line 17386 of file ripper.c.
References ID_CONST, and rb_str_symname_type().
Referenced by new_struct(), rb_is_attr_name(), rb_mod_const_defined(), rb_mod_const_get(), and rb_mod_remove_const().
| int rb_is_global_id | ( | ID | ) |
Definition at line 17280 of file ripper.c.
References is_global_id.
| int rb_is_global_name | ( | VALUE | name | ) |
Definition at line 17398 of file ripper.c.
References ID_GLOBAL, and rb_str_symname_type().
| int rb_is_instance_id | ( | ID | ) |
Definition at line 17286 of file ripper.c.
References is_instance_id.
Referenced by inspect_i(), ivar_i(), rb_obj_ivar_defined(), rb_obj_ivar_get(), and rb_obj_remove_instance_variable().
| int rb_is_instance_name | ( | VALUE | name | ) |
Definition at line 17404 of file ripper.c.
References ID_INSTANCE, and rb_str_symname_type().
Referenced by rb_obj_ivar_defined(), rb_obj_ivar_get(), and rb_obj_remove_instance_variable().
| int rb_is_junk_id | ( | ID | ) |
Definition at line 17304 of file ripper.c.
References is_junk_id.
| int rb_is_junk_name | ( | VALUE | name | ) |
Definition at line 17432 of file ripper.c.
References IDSET_ATTRSET_FOR_SYNTAX, and rb_str_symname_type().
| int rb_is_local_id | ( | ID | ) |
Definition at line 17298 of file ripper.c.
References is_local_id.
Referenced by check_local_id(), collect_local_variables_in_iseq(), inspect_struct(), and rb_is_attr_id().
| int rb_is_local_name | ( | VALUE | name | ) |
Definition at line 17416 of file ripper.c.
References ID_LOCAL, and rb_str_symname_type().
Referenced by check_local_id(), and rb_is_attr_name().
| int rb_is_method_name | ( | VALUE | name | ) |
Definition at line 17422 of file ripper.c.
References FALSE, ID_ATTRSET, ID_JUNK, ID_LOCAL, rb_str_symname_type(), and TRUE.
| int rb_isalnum | ( | int | c | ) |
Definition at line 1921 of file encoding.c.
References ctype_test, and ONIGENC_CTYPE_ALNUM.
| int rb_isalpha | ( | int | c | ) |
Definition at line 1922 of file encoding.c.
References ctype_test, and ONIGENC_CTYPE_ALPHA.
| int rb_isblank | ( | int | c | ) |
Definition at line 1923 of file encoding.c.
References ctype_test, and ONIGENC_CTYPE_BLANK.
| int rb_iscntrl | ( | int | c | ) |
Definition at line 1924 of file encoding.c.
References ctype_test, and ONIGENC_CTYPE_CNTRL.
| int rb_isdigit | ( | int | c | ) |
Definition at line 1925 of file encoding.c.
References ctype_test, and ONIGENC_CTYPE_DIGIT.
Referenced by f_format().
Definition at line 881 of file iseq.c.
References rb_iseq_location_struct::absolute_path, GetISeqPtr, and rb_iseq_struct::location.
Definition at line 940 of file iseq.c.
References rb_iseq_location_struct::base_label, GetISeqPtr, and rb_iseq_struct::location.
Definition at line 1922 of file iseq.c.
References rb_iseq_struct::cref_stack, GetISeqPtr, iseq_alloc(), ISEQ_SET_CREF, rb_iseq_struct::klass, rb_iseq_struct::local_iseq, MEMCPY, NEW_CREF, rb_iseq_struct::orig, rb_cISeq, RB_OBJ_WRITE, and rb_iseq_struct::self.
Definition at line 958 of file iseq.c.
References rb_iseq_location_struct::first_lineno, GetISeqPtr, and rb_iseq_struct::location.
Definition at line 966 of file iseq.c.
References GetISeqPtr, rb_iseq_struct::klass, and rb_iseq_struct::local_iseq.
Definition at line 912 of file iseq.c.
References GetISeqPtr, rb_iseq_location_struct::label, and rb_iseq_struct::location.
Definition at line 974 of file iseq.c.
References rb_iseq_location_struct::base_label, GetISeqPtr, rb_iseq_struct::local_iseq, rb_iseq_struct::location, Qnil, and rb_iseq_struct::type.
Definition at line 857 of file iseq.c.
References GetISeqPtr, rb_iseq_struct::location, and rb_iseq_location_struct::path.
| int rb_isgraph | ( | int | c | ) |
Definition at line 1926 of file encoding.c.
References ctype_test, and ONIGENC_CTYPE_GRAPH.
| int rb_islower | ( | int | c | ) |
Definition at line 1927 of file encoding.c.
References ctype_test, and ONIGENC_CTYPE_LOWER.
| int rb_isprint | ( | int | c | ) |
Definition at line 1928 of file encoding.c.
References ctype_test, and ONIGENC_CTYPE_PRINT.
| int rb_ispunct | ( | int | c | ) |
Definition at line 1929 of file encoding.c.
References ctype_test, and ONIGENC_CTYPE_PUNCT.
Referenced by rb_id2str().
| int rb_isspace | ( | int | c | ) |
Definition at line 1930 of file encoding.c.
References ctype_test, and ONIGENC_CTYPE_SPACE.
Referenced by rb_str_lstrip_bang(), rb_str_rstrip_bang(), and rb_str_split_m().
| int rb_isupper | ( | int | c | ) |
Definition at line 1931 of file encoding.c.
References ctype_test, and ONIGENC_CTYPE_UPPER.
| int rb_isxdigit | ( | int | c | ) |
Definition at line 1932 of file encoding.c.
References ctype_test, and ONIGENC_CTYPE_XDIGIT.
Definition at line 1052 of file vm_eval.c.
References rb_thread_struct::cfp, rb_control_frame_struct::ep, err, rb_thread_struct::errinfo, GET_THREAD(), GET_THROWOBJ_CATCH_POINT, GET_THROWOBJ_VAL, rb_block_struct::iseq, NEW_IFUNC, rb_thread_struct::passed_block, rb_block_struct::proc, Qnil, rb_frame_this_func(), rb_vm_rewind_cfp(), RUBY_VM_GET_BLOCK_PTR_IN_CFP, rb_thread_struct::state, TAG_BREAK, TAG_RETRY, TH_EXEC_TAG, TH_JUMP_TAG, TH_POP_TAG, TH_PUSH_TAG, and VM_CF_BLOCK_PTR().
Definition at line 2601 of file variable.c.
References rb_intern, and rb_ivar_get().
Definition at line 2609 of file variable.c.
References rb_intern, and rb_ivar_set().
| st_index_t rb_ivar_count | ( | VALUE | ) |
Definition at line 1302 of file variable.c.
References BUILTIN_TYPE, count, FL_EXIVAR, FL_TEST, st_table::num_entries, Qundef, rb_special_const_p(), RCLASS_IV_TBL, ROBJECT_IV_INDEX_TBL, ROBJECT_IVPTR, SPECIAL_CONST_P, st_data_t, st_lookup(), T_CLASS, T_MODULE, and T_OBJECT.
Definition at line 1207 of file variable.c.
References BUILTIN_TYPE, FL_EXIVAR, FL_TEST, generic_ivar_defined(), Qfalse, Qtrue, Qundef, rb_special_const_p(), RCLASS_IV_TBL, ROBJECT_IV_INDEX_TBL, ROBJECT_IVPTR, ROBJECT_NUMIV, SPECIAL_CONST_P, st_data_t, st_lookup(), T_CLASS, T_MODULE, T_OBJECT, and val.
Definition at line 1274 of file variable.c.
References BUILTIN_TYPE, FL_EXIVAR, FL_TEST, func, obj_ivar_each(), rb_special_const_p(), RCLASS_IV_TBL, SPECIAL_CONST_P, st_data_t, st_foreach_safe(), st_lookup(), T_CLASS, T_MODULE, and T_OBJECT.
Definition at line 1115 of file variable.c.
References PRIsVALUE, Qnil, Qundef, QUOTE_ID, rb_ivar_lookup(), and rb_warning().
Definition at line 1133 of file variable.c.
References ALLOC_N, st_table::as, BUILTIN_TYPE, generic_ivar_set(), MEMCPY, st_table::num_entries, Qundef, rb_check_frozen, rb_obj_class(), RB_OBJ_WRITE, rb_st_insert_id_and_value(), RBASIC, RCLASS_IV_INDEX_TBL, RCLASS_IV_TBL, REALLOC_N, ROBJECT, ROBJECT_EMBED, ROBJECT_EMBED_LEN_MAX, ROBJECT_IV_INDEX_TBL, ROBJECT_IVPTR, ROBJECT_NUMIV, SPECIAL_CONST_P, st_add_direct(), st_data_t, st_init_numtable(), st_lookup(), T_CLASS, T_MODULE, and T_OBJECT.
| void rb_last_status_clear | ( | void | ) |
Definition at line 336 of file process.c.
References GET_THREAD(), rb_thread_struct::last_status, and Qnil.
| VALUE rb_last_status_get | ( | void | ) |
Definition at line 321 of file process.c.
References GET_THREAD(), and rb_thread_struct::last_status.
| void rb_last_status_set | ( | int | status, |
| rb_pid_t | pid | ||
| ) |
Definition at line 327 of file process.c.
References GET_THREAD(), INT2FIX, rb_thread_struct::last_status, PIDT2NUM, rb_cProcessStatus, rb_iv_set(), and rb_obj_alloc().
| VALUE rb_lastline_get | ( | void | ) |
Definition at line 924 of file vm.c.
References vm_svar_get().
| void rb_lastline_set | ( | VALUE | ) |
Definition at line 930 of file vm.c.
References vm_svar_set().
Definition at line 1730 of file rational.c.
References f_lcm(), and nurat_int_value().
| void rb_load | ( | VALUE | , |
| int | |||
| ) |
Definition at line 648 of file load.c.
References FilePathValue, load_failed(), rb_find_file(), and rb_load_internal().
| void* rb_load_file | ( | const char * | ) |
Definition at line 824 of file pepper_main.c.
References PepperInstance::as_int, PepperInstance::as_value, PepperInstance::async_call_args, PepperInstance::async_call_result, PepperInstance::cond, core_interface, f, FIXNUM_P, GET_PEPPER_INSTANCE, PepperInstance::instance, load_file_internal(), load_file_read_contents(), PepperInstance::mutex, pruby_file_fetch_check_response(), rb_compile_cstr(), rb_load_file_str(), rb_str_new_cstr(), RB_TYPE_P, RSTRING_LEN, RSTRING_PTR, and T_STRING.
| void* rb_load_file_str | ( | VALUE | ) |
Definition at line 1776 of file ruby.c.
References cmdline_options_init(), load_file(), and rb_parser_new().
| void rb_load_protect | ( | VALUE | , |
| int | , | ||
| int * | |||
| ) |
| int rb_local_defined | ( | ID | ) |
Definition at line 5923 of file compile.c.
References rb_thread_struct::base_block, GET_THREAD(), rb_block_struct::iseq, rb_iseq_struct::local_iseq, rb_iseq_struct::local_table, and rb_iseq_struct::local_table_size.
Referenced by local_id_gen().
Definition at line 23 of file localeinit.c.
References nl_langinfo_codeset(), Qnil, rb_usascii_str_new2, and snprintf.
| int rb_locale_encindex | ( | void | ) |
Definition at line 1272 of file encoding.c.
References enc_alias_internal(), Init_w32_codepage(), NIL_P, rb_cEncoding, rb_enc_find_index(), rb_enc_registered(), rb_locale_charmap(), and StringValueCStr.
Referenced by rb_locale_encoding().
| rb_encoding* rb_locale_encoding | ( | void | ) |
Definition at line 1294 of file encoding.c.
References rb_enc_from_index(), and rb_locale_encindex().
Referenced by env_str_new(), load_file_internal(), locale_path(), process_options(), rb_default_external_encoding(), rb_loaderror(), rb_loaderror_with_path(), rb_locale_str_new(), rb_locale_str_new_cstr(), rb_str_export_locale(), rb_strftime_with_timespec(), readline_attempted_completion_function(), and syserr_initialize().
Definition at line 719 of file string.c.
References rb_external_str_new_with_enc(), and rb_locale_encoding().
Definition at line 725 of file string.c.
References rb_external_str_new_with_enc(), rb_locale_encoding(), and strlen().
|
inlinestatic |
Definition at line 1302 of file ruby.h.
References FIXABLE, LONG2FIX, and rb_int2big().
| VALUE rb_make_backtrace | ( | void | ) |
Definition at line 817 of file vm_backtrace.c.
References GET_THREAD(), and rb_vm_backtrace_str_ary().
| VALUE rb_make_backtrace | ( | void | ) |
Definition at line 817 of file vm_backtrace.c.
Definition at line 682 of file eval.c.
References make_exception(), and TRUE.
Referenced by parser_set_encode(), rb_f_raise(), and rb_threadptr_raise().
| void rb_mark_end_proc | ( | void | ) |
Definition at line 80 of file eval_jump.c.
References end_proc_data::data, end_procs, ephemeral_end_procs, link(), end_proc_data::next, and rb_gc_mark().
Referenced by gc_mark_roots().
| void rb_mark_generic_ivar | ( | VALUE | ) |
Definition at line 992 of file variable.c.
References rb_mark_tbl(), st_data_t, and st_lookup().
| void rb_mark_generic_ivar_tbl | ( | void | ) |
Definition at line 1022 of file variable.c.
References givar_i(), and st_foreach_safe().
| void rb_mark_hash | ( | struct st_table * | ) |
Definition at line 3381 of file gc.c.
References mark_hash().
| void rb_mark_set | ( | struct st_table * | ) |
Definition at line 3357 of file gc.c.
References mark_set().
| void rb_mark_tbl | ( | struct st_table * | ) |
Definition at line 3519 of file gc.c.
References mark_tbl().
| void rb_marshal_define_compat | ( | VALUE | newclass, |
| VALUE | oldclass, | ||
| VALUE(*)(VALUE) | dumper, | ||
| VALUE(*)(VALUE, VALUE) | loader | ||
| ) |
Definition at line 113 of file marshal.c.
References ALLOC, marshal_compat_t::dumper, marshal_compat_t::loader, marshal_compat_t::newclass, marshal_compat_t::oldclass, Qnil, rb_eTypeError, rb_get_alloc_func(), rb_raise(), st_data_t, and st_insert().
Definition at line 2150 of file marshal.c.
References marshal_load().
| void rb_maygvl_fd_fix_cloexec | ( | int | fd | ) |
| void rb_mem_clear | ( | register VALUE * | , |
| register | long | ||
| ) |
Definition at line 35 of file array.c.
References Qnil.
Referenced by ary_mem_clear(), rb_struct_initialize_m(), and struct_alloc().
| st_index_t rb_memhash | ( | const void * | ptr, |
| long | len | ||
| ) |
Definition at line 1302 of file random.c.
References sip_hash24, sipseed, and sip_uint64_t::u32.
| long rb_memsearch | ( | const void * | , |
| long | , | ||
| const void * | , | ||
| long | , | ||
| rb_encoding * | |||
| ) |
Definition at line 227 of file re.c.
References memcmp(), rb_memsearch_qs(), rb_memsearch_qs_utf8(), rb_memsearch_ss(), rb_utf8_encoding(), and SIZEOF_VALUE.
Definition at line 1572 of file vm_method.c.
References rb_method_entry_struct::flag, NOEX_BASIC, and rb_method_entry().
Definition at line 835 of file vm_method.c.
References rb_method_entry_struct::def, rb_method_entry_struct::flag, NOEX_PRIVATE, NOEX_PROTECTED, NOEX_RESPONDS, rb_method_entry_without_refinements(), rb_method_definition_struct::type, and VM_METHOD_TYPE_NOTIMPLEMENTED.
Definition at line 1800 of file proc.c.
References Qnil, rb_block_given_p(), rb_block_proc(), and rb_method_call_with_block().
Definition at line 1807 of file proc.c.
References rb_proc_t::block, BUILTIN_TYPE, METHOD::defined_class, EXEC_TAG, GET_THREAD(), GetProcPtr, METHOD::id, JUMP_TAG, METHOD::me, method_data_type, NIL_P, OBJ_TAINTED, rb_thread_struct::passed_block, POP_TAG, PUSH_TAG, Qnil, Qundef, rb_eTypeError, rb_raise(), rb_safe_level, rb_set_safe_level_force(), rb_vm_call(), METHOD::rclass, METHOD::recv, result, T_MODULE, and TypedData_Get_Struct.
Definition at line 2528 of file variable.c.
References cvar_list(), mod_cvar_at(), mod_cvar_of(), Qtrue, rb_scan_args(), and RTEST.
| void* rb_mod_const_at | ( | VALUE | , |
| void * | |||
| ) |
Definition at line 2004 of file variable.c.
References RCLASS_CONST_TBL, st_data_t, st_foreach_safe(), st_init_numtable(), and sv_i().
Definition at line 1519 of file variable.c.
References rb_to_id(), rb_vm_pop_cfunc_frame(), uninitialized_constant(), and UNREACHABLE.
| void* rb_mod_const_of | ( | VALUE | , |
| void * | |||
| ) |
Definition at line 2017 of file variable.c.
References mod, rb_cObject, rb_mod_const_at(), and RCLASS_SUPER.
Definition at line 2068 of file variable.c.
References Qtrue, rb_const_list(), rb_local_constants(), rb_mod_const_of(), rb_scan_args(), and RTEST.
Definition at line 2120 of file proc.c.
References METHOD::me, original_method_entry(), and rb_method_entry_arity().
Definition at line 1676 of file vm_eval.c.
References specific_eval().
Definition at line 1704 of file vm_eval.c.
References rb_ary_new4, and yield_under().
Definition at line 206 of file variable.c.
References classname(), NIL_P, fc_result::path, and rb_str_dup().
Definition at line 1920 of file variable.c.
References PRIsVALUE, QUOTE, QUOTE_ID, rb_check_id(), rb_class_name(), rb_const_remove(), rb_is_const_id(), rb_is_const_name(), rb_name_error(), and rb_name_error_str().
Definition at line 2569 of file variable.c.
References id, PRIsVALUE, QUOTE, QUOTE_ID, rb_check_frozen, rb_check_id(), rb_class_name(), rb_cvar_defined(), rb_is_class_id(), rb_is_class_name(), rb_name_error(), rb_name_error_str(), RCLASS_IV_TBL, st_data_t, st_delete(), UNREACHABLE, and val.
| void rb_must_asciicompat | ( | VALUE | ) |
Definition at line 1580 of file string.c.
References rb_eEncCompatError, rb_enc_asciicompat, rb_enc_get(), rb_enc_name, and rb_raise().
| void rb_mutex_allow_trap | ( | VALUE | self, |
| int | val | ||
| ) |
Definition at line 4642 of file thread.c.
References rb_mutex_struct::allow_trap, and GetMutexPtr.
Definition at line 4373 of file thread.c.
References rb_mutex_struct::allow_trap, FALSE, GET_THREAD(), GetMutexPtr, GVL_UNLOCK_BEGIN, GVL_UNLOCK_END, rb_thread_struct::interrupt_mask, rb_mutex_struct::lock, lock_func(), lock_interrupt(), rb_thread_struct::locking_mutex, mutex_locked(), NULL, Qfalse, rb_check_deadlock(), rb_eThreadError, rb_mutex_trylock(), rb_raise(), reset_unblock_function(), RUBY_VM_CHECK_INTS_BLOCKING, set_unblock_function(), rb_vm_struct::sleeper, rb_thread_struct::status, rb_mutex_struct::th, THREAD_STOPPED_FOREVER, TRAP_INTERRUPT_MASK, rb_thread_struct::vm, and vm_living_thread_num().
Definition at line 4263 of file thread.c.
References GetMutexPtr, Qfalse, Qtrue, and rb_mutex_struct::th.
| VALUE rb_mutex_new | ( | void | ) |
Definition at line 4251 of file thread.c.
References mutex_alloc(), and rb_cMutex.
Definition at line 4449 of file thread.c.
References GET_THREAD(), GetMutexPtr, Qfalse, Qtrue, and rb_mutex_struct::th.
Definition at line 4567 of file thread.c.
References INT2FIX, NIL_P, Qnil, rb_ensure(), rb_mutex_lock(), rb_mutex_sleep_forever(), rb_mutex_unlock(), rb_mutex_wait_for(), and rb_time_interval().
Definition at line 4619 of file thread.c.
References func, rb_ensure(), rb_mutex_lock(), and rb_mutex_unlock().
Definition at line 4290 of file thread.c.
References GET_THREAD(), GetMutexPtr, rb_mutex_struct::lock, mutex_locked(), Qfalse, Qtrue, and rb_mutex_struct::th.
Definition at line 4504 of file thread.c.
References err, GET_THREAD(), GetMutexPtr, rb_eThreadError, rb_mutex_unlock_th(), and rb_raise().
Definition at line 385 of file variable.c.
References classid, ID2SYM, and rb_ivar_set().
| void rb_need_block | ( | void | ) |
Definition at line 733 of file eval.c.
References Qnil, rb_block_given_p(), and rb_vm_localjump_error().
Referenced by generator_initialize(), and yielder_initialize().
| VALUE rb_newobj | ( | void | ) |
Definition at line 1348 of file gc.c.
References newobj_of(), and T_NONE.
| rb_serial_t rb_next_class_serial | ( | void | ) |
Definition at line 92 of file vm.c.
References NEXT_CLASS_SERIAL.
Definition at line 1360 of file gc.c.
References FL_WB_PROTECTED, nd_set_type, newobj_of(), NODE_CREF, RGENGC_WB_PROTECTED_NODE_CREF, and T_NODE.
|
inlinestatic |
Definition at line 1322 of file ruby.h.
References NUM2INT, RSTRING_LEN, RSTRING_PTR, T_STRING, and TYPE.
| double rb_num2dbl | ( | VALUE | ) |
Definition at line 2965 of file object.c.
References rb_eTypeError, rb_Float(), rb_raise(), RFLOAT_VALUE, T_FLOAT, T_NIL, T_STRING, and TYPE.
Definition at line 2273 of file numeric.c.
References FIXABLE, FIXNUM_P, LONG2FIX, rb_eRangeError, rb_num2long(), and rb_raise().
| SIGNED_VALUE rb_num2long | ( | VALUE | ) |
Definition at line 2029 of file numeric.c.
References buf, FIX2LONG, FIXNUM_P, LONG_MAX_PLUS_ONE, LONG_MIN_MINUS_ONE_IS_LESS_THAN, NIL_P, rb_big2long(), rb_eRangeError, rb_eTypeError, rb_raise(), rb_to_int(), RB_TYPE_P, RFLOAT_VALUE, snprintf, strchr(), T_BIGNUM, and T_FLOAT.
|
inlinestatic |
Definition at line 593 of file ruby.h.
References FIX2LONG, FIXNUM_P, and rb_num2long().
| short rb_num2short | ( | VALUE | ) |
Definition at line 2231 of file numeric.c.
References check_short(), and rb_num2long().
|
inlinestatic |
Definition at line 642 of file ruby.h.
References FIX2SHORT, FIXNUM_P, and rb_num2short().
Definition at line 2109 of file numeric.c.
References NULL, and rb_num2ulong_internal().
|
inlinestatic |
Definition at line 602 of file ruby.h.
References FIX2LONG, FIXNUM_P, and rb_num2ulong().
| unsigned short rb_num2ushort | ( | VALUE | ) |
Definition at line 2249 of file numeric.c.
References check_ushort(), and rb_num2ulong_internal().
Definition at line 280 of file numeric.c.
References do_coerce(), rb_funcall(), and TRUE.
Definition at line 3309 of file numeric.c.
References bit_coerce(), rb_funcall(), and TRUE.
Definition at line 287 of file numeric.c.
References do_coerce(), FALSE, Qnil, and rb_funcall().
Definition at line 295 of file numeric.c.
References c, do_coerce(), FALSE, NIL_P, Qnil, rb_cmperr(), and rb_funcall().
| int rb_num_negative_p | ( | VALUE | ) |
Definition at line 197 of file numeric.c.
References negative_int_p().
| int rb_num_to_uint | ( | VALUE | val, |
| unsigned int * | ret | ||
| ) |
Definition at line 132 of file numeric.c.
References FIX2LONG, FIXNUM_P, NULL, NUMERR_NEGATIVE, NUMERR_TOOLARGE, NUMERR_TYPE, rb_absint_size(), rb_big2ulong(), RB_TYPE_P, RBIGNUM_NEGATIVE_P, and T_BIGNUM.
Definition at line 1802 of file object.c.
References FL_SINGLETON, FL_TEST, PRIsVALUE, rb_cBasicObject, rb_class2name(), rb_class_real(), rb_eTypeError, rb_get_alloc_func(), rb_obj_class(), rb_raise(), rb_sourcefile, rb_sourceline(), RCLASS_SUPER, RUBY_DTRACE_OBJECT_CREATE, and RUBY_DTRACE_OBJECT_CREATE_ENABLED.
Definition at line 1011 of file string.c.
References id_to_s, OBJ_TAINT, OBJ_TAINTED, rb_any_to_s(), rb_funcall(), RB_TYPE_P, and T_STRING.
Definition at line 1298 of file eval.c.
References PASS_PASSED_BLOCK, and rb_funcall2.
Referenced by rb_class_new_instance(), rb_digest_class_s_digest(), rb_proc_s_new(), and thread_s_new().
Definition at line 227 of file object.c.
References CLASS_OF, and rb_class_real().
Definition at line 406 of file variable.c.
References CLASS_OF, and rb_class2name().
Definition at line 338 of file object.c.
References FL_FINALIZE, FL_FREEZE, FL_PROMOTED, FL_SINGLETON, FL_TAINT, FL_TEST, FL_WB_PROTECTED, id_init_clone, init_copy(), rb_eTypeError, rb_funcall(), rb_obj_alloc(), rb_obj_class(), rb_obj_classname(), rb_raise(), rb_singleton_class_attached(), rb_singleton_class_clone_and_attach(), rb_special_const_p(), RBASIC, and RBASIC_SET_CLASS.
Definition at line 256 of file object.c.
References ALLOC_N, MEMCPY, RBASIC, ROBJECT, ROBJECT_EMBED, ROBJECT_EMBED_LEN_MAX, ROBJECT_IVPTR, and xfree.
Definition at line 407 of file object.c.
References id_init_dup, init_copy(), rb_eTypeError, rb_funcall(), rb_obj_alloc(), rb_obj_class(), rb_obj_classname(), rb_raise(), and rb_special_const_p().
Definition at line 930 of file encoding.c.
References ENC_INDEX_MASK, rb_enc_from_encoding_index(), rb_enc_get_index(), rb_eTypeError, and rb_raise().
Referenced by Init_Regexp(), Init_String(), lib_toUTF8_core(), str_transcode0(), and sym_encoding().
Definition at line 1077 of file object.c.
References OBJ_FREEZE, OBJ_FROZEN, Qtrue, SPECIAL_CONST_P, st_data_t, st_init_numtable(), and st_insert().
Definition at line 1103 of file object.c.
References OBJ_FROZEN, Qfalse, Qtrue, SPECIAL_CONST_P, and st_lookup().
Definition at line 53 of file object.c.
References RBASIC_CLEAR_CLASS, and SPECIAL_CONST_P.
Definition at line 2373 of file gc.c.
References FIXNUM_FLAG, FLONUM_P, LONG2NUM, nonspecial_obj_id, SIGNED_VALUE, SPECIAL_CONST_P, SYM2ID, and SYMBOL_P.
Definition at line 1048 of file object.c.
References OBJ_INFECT.
Definition at line 423 of file object.c.
References rb_check_frozen, rb_check_trusted, rb_eTypeError, rb_obj_class(), rb_raise(), and TYPE.
Definition at line 1605 of file vm_eval.c.
References rb_singleton_class(), rb_special_singleton_class(), SPECIAL_CONST_P, and specific_eval().
Definition at line 1637 of file vm_eval.c.
References rb_ary_new4, rb_singleton_class(), rb_special_singleton_class(), SPECIAL_CONST_P, and yield_under().
Definition at line 1371 of file variable.c.
References ivar_i(), rb_ary_new(), and rb_ivar_foreach().
Definition at line 370 of file cont.c.
References Qfalse, Qtrue, and rb_typeddata_is_kind_of().
Referenced by rb_objspace_call_finalizer().
Definition at line 616 of file object.c.
References class_or_module_required(), Qfalse, Qtrue, and rb_obj_class().
Definition at line 653 of file object.c.
References CLASS_OF, class_or_module_required(), class_search_ancestor(), Qfalse, Qtrue, and RCLASS_ORIGIN.
Definition at line 1116 of file proc.c.
References method_data_type, Qfalse, Qtrue, and rb_typeddata_is_kind_of().
Definition at line 4216 of file thread.c.
References Qfalse, Qtrue, and rb_typeddata_is_kind_of().
Definition at line 94 of file proc.c.
References Qfalse, Qtrue, and rb_typeddata_is_kind_of().
Definition at line 2120 of file vm.c.
References Qfalse, Qtrue, rb_typeddata_is_kind_of(), and thread_data_type.
| size_t rb_obj_memsize_of | ( | VALUE | ) |
Definition at line 2548 of file gc.c.
References obj_memsize_of(), and TRUE.
Definition at line 1460 of file proc.c.
References CLASS_OF, FALSE, mnew(), rb_check_id(), rb_cMethod, and rb_method_name_error().
Definition at line 2128 of file proc.c.
References CLASS_OF, and rb_mod_method_arity().
Definition at line 1403 of file variable.c.
References BUILTIN_TYPE, FL_EXIVAR, FL_TEST, generic_ivar_remove(), id, PRIsVALUE, Qnil, Qundef, QUOTE, QUOTE_ID, rb_check_frozen, rb_check_id(), rb_is_instance_id(), rb_is_instance_name(), rb_name_error(), rb_name_error_str(), rb_special_const_p(), RCLASS_IV_TBL, ROBJECT_IV_INDEX_TBL, ROBJECT_IVPTR, ROBJECT_NUMIV, SPECIAL_CONST_P, st_data_t, st_delete(), st_lookup(), T_CLASS, T_MODULE, T_OBJECT, UNREACHABLE, and val.
Definition at line 1599 of file vm_method.c.
References basic_obj_respond_to(), CLASS_OF, FL_SINGLETON, FL_TEST, ID2SYM, idRespond_to, NIL_P, NUM2INT, PRIsVALUE, Qtrue, QUOTE_ID, RARRAY_AREF, rb_compile_warn(), rb_funcall2, rb_method_basic_definition_p(), rb_mod_method_location(), rb_obj_method_arity(), rb_warn(), RSTRING_PTR, RTEST, and ruby_verbose.
Definition at line 62 of file object.c.
References RBASIC_SET_CLASS, and SPECIAL_CONST_P.
Definition at line 71 of file object.c.
References FL_SET, FL_TAINT, rb_safe_level, RBASIC, RBASIC_SET_CLASS, and type.
Definition at line 974 of file object.c.
References OBJ_TAINT, OBJ_TAINTED, and rb_check_frozen.
Definition at line 946 of file object.c.
References OBJ_TAINTED, Qfalse, and Qtrue.
Definition at line 1041 of file object.c.
References rb_obj_untaint(), and rb_warning().
Definition at line 994 of file object.c.
References FL_TAINT, FL_UNSET, OBJ_TAINTED, rb_check_frozen, and rb_secure().
Definition at line 1026 of file object.c.
References rb_obj_taint(), and rb_warning().
Definition at line 1012 of file object.c.
References rb_obj_tainted(), and rb_warning().
|
inlinestatic |
Definition at line 1226 of file ruby.h.
References FL_PROMOTED, FL_TEST_RAW, FL_WB_PROTECTED, rb_gc_writebarrier_unprotect_promoted(), and RBASIC.
|
inlinestatic |
Definition at line 1262 of file ruby.h.
References Qundef, and rb_obj_written().
|
inlinestatic |
Definition at line 1245 of file ruby.h.
References FL_PROMOTED, FL_TEST_RAW, rb_gc_writebarrier(), and SPECIAL_CONST_P.
Referenced by rb_obj_write().
| RUBY_SYMBOL_EXPORT_BEGIN const char* rb_objspace_data_type_name | ( | VALUE | obj | ) |
Definition at line 1394 of file gc.c.
References RTYPEDDATA_P, and RTYPEDDATA_TYPE.
| void rb_objspace_set_event_hook | ( | const rb_event_flag_t | event | ) |
Definition at line 1265 of file gc.c.
References rb_objspace::hook_events, rb_objspace, and RUBY_INTERNAL_EVENT_OBJSPACE_MASK.
| void rb_p | ( | VALUE | ) |
Definition at line 7032 of file io.c.
References CLASS_OF, id_write, io_write(), rb_default_rs, rb_inspect(), rb_io_write(), rb_method_basic_definition_p(), rb_obj_as_string(), rb_stdout, RB_TYPE_P, and T_FILE.
| int rb_parse_in_eval | ( | void | ) |
Definition at line 5942 of file compile.c.
References GET_THREAD(), and rb_thread_struct::parse_in_eval.
Referenced by parser_compile_string(), and rb_parser_compile_file_path().
| int rb_parse_in_main | ( | void | ) |
Definition at line 5948 of file compile.c.
References GET_THREAD(), and rb_thread_struct::parse_in_eval.
Referenced by yyparse().
Definition at line 16609 of file ripper.c.
References block_append, nd_type, NEW_ARRAY, NEW_FCALL, NEW_GVAR, NODE_PRELUDE, rb_intern, and TypedData_Get_Struct.
Referenced by process_options().
| void* rb_parser_calloc | ( | struct parser_params * | , |
| size_t | , | ||
| size_t | |||
| ) |
Definition at line 12094 of file ripper.c.
References parser_compile_string(), rb_filesystem_str_new_cstr(), and rb_str_new().
Definition at line 12115 of file ripper.c.
References rb_filesystem_str_new_cstr(), and rb_parser_compile_file_path().
Referenced by iseq_s_compile_file(), and rb_compile_file().
Definition at line 12121 of file ripper.c.
References compile_for_eval, lex_gets, lex_input, lex_io_gets(), lex_p, lex_pbeg, lex_pend, RB_GC_GUARD, rb_parse_in_eval(), TypedData_Get_Struct, and yycompile().
Referenced by load_file_internal(), rb_iseq_compile_with_option(), and rb_parser_compile_file().
Definition at line 12074 of file ripper.c.
References rb_filesystem_str_new_cstr(), and rb_parser_compile_string_path().
Referenced by process_options().
Definition at line 12080 of file ripper.c.
References must_be_ascii_compatible(), and parser_compile_string().
Referenced by load_file_internal(), rb_iseq_compile_with_option(), and rb_parser_compile_string().
Definition at line 894 of file node.c.
References buf, dump_node(), and rb_str_new_cstr().
Definition at line 17616 of file ripper.c.
References current_enc, rb_enc_from_encoding(), and TypedData_Get_Struct.
Referenced by load_file_internal().
Definition at line 17601 of file ripper.c.
References Qfalse, Qtrue, ruby__end__seen, and TypedData_Get_Struct.
Referenced by load_file_internal().
| void rb_parser_free | ( | struct parser_params * | , |
| void * | |||
| ) |
Definition at line 17702 of file ripper.c.
References parser_params::heap, RNode::node, NULL, rb_gc_force_recycle(), RNode::u2, and xfree.
Definition at line 17631 of file ripper.c.
References Qfalse, Qtrue, and TypedData_Get_Struct.
| void* rb_parser_malloc | ( | struct parser_params * | , |
| size_t | |||
| ) |
| RUBY_SYMBOL_EXPORT_BEGIN VALUE rb_parser_new | ( | void | ) |
Definition at line 17587 of file ripper.c.
References parser_new(), and TypedData_Wrap_Struct.
Referenced by iseq_s_compile_file(), process_options(), rb_compile_cstr(), rb_compile_file(), rb_compile_string(), rb_iseq_compile_with_option(), and rb_load_file_str().
| void* rb_parser_realloc | ( | struct parser_params * | , |
| void * | , | ||
| size_t | |||
| ) |
Definition at line 17682 of file ripper.c.
References ADD2HEAP, RNode::cnt, cnt, parser_params::heap, HEAPCNT, NEWHEAP, RNode::node, NULL, RNode::u1, RNode::u2, RNode::u3, and xrealloc.
Definition at line 17646 of file ripper.c.
References RTEST, and TypedData_Get_Struct.
Referenced by process_options().
Definition at line 16641 of file ripper.c.
References block_append, nd_type, NEW_CALL, NEW_GASGN, NEW_GVAR, NEW_OPT_N, NODE_PRELUDE, rb_intern, and TypedData_Get_Struct.
Referenced by process_options().
Definition at line 379 of file variable.c.
References rb_path_to_class(), and rb_str_new_cstr().
| int rb_path_check | ( | const char * | ) |
Definition at line 5360 of file file.c.
References path_check_0(), PATH_SEP_CHAR, rb_str_new(), strchr(), strlen(), and TRUE.
Definition at line 339 of file variable.c.
References c, id, fc_result::path, PRIsVALUE, QUOTE, rb_check_id_cstr(), rb_cObject, rb_const_defined_at(), rb_const_get_at(), rb_eArgError, rb_enc_asciicompat, rb_enc_get(), rb_eTypeError, RB_GC_GUARD, rb_raise(), RB_TYPE_P, RSTRING_PTR, T_CLASS, and T_MODULE.
| int rb_pipe | ( | int * | pipes | ) |
Definition at line 5651 of file io.c.
References errno, rb_cloexec_pipe(), rb_gc(), and rb_update_max_fd().
| int rb_proc_arity | ( | VALUE | ) |
Definition at line 872 of file proc.c.
References GetProcPtr, rb_proc_t::is_lambda, max(), rb_proc_min_max_arity(), and UNLIMITED_ARGUMENTS.
Definition at line 754 of file proc.c.
References check_argc, GET_THREAD(), GetProcPtr, RARRAY_CONST_PTR, RARRAY_LEN, RB_GC_GUARD, and rb_vm_invoke_proc().
Definition at line 766 of file proc.c.
References rb_proc_t::block, GET_THREAD(), GetProcPtr, NIL_P, RB_GC_GUARD, and rb_vm_invoke_proc().
| int rb_proc_exec | ( | const char * | ) |
Definition at line 1359 of file process.c.
References after_exec(), before_exec(), preserving_errno, proc_exec_sh(), and Qfalse.
Definition at line 234 of file proc.c.
References GetProcPtr, rb_proc_t::is_lambda, Qfalse, and Qtrue.
Definition at line 949 of file proc.c.
References get_proc_iseq, and iseq_location().
Definition at line 2321 of file proc.c.
References func, mproc(), and rb_iterate().
Definition at line 807 of file eval.c.
References rb_thread_struct::cfp, GET_THREAD(), MEMCPY, rb_vm_protect_tag::prev, rb_thread_struct::protect_tag, Qnil, rb_vm_rewind_cfp(), result, SAVE_ROOT_JMPBUF, TH_EXEC_TAG, TH_POP_TAG, and TH_PUSH_TAG.
Referenced by BigDecimal_save_exception_mode(), BigDecimal_save_limit(), BigDecimal_save_rounding_mode(), decode_enum(), decode_int(), decode_time(), EVENTSINK_Invoke(), exc_equal(), fdbm_delete_if(), fgdbm_delete_if(), fsdbm_delete_if(), goruby_run_node(), gzfile_wrap(), init_libraries(), io_s_write(), ip_eval_real(), ip_invoke_core(), ip_ruby_cmd_receiver_get(), lib_eventloop_core(), lib_eventloop_main(), lib_thread_callback(), load_encoding(), name_err_mesg_to_str(), ossl_buf2str(), ossl_client_cert_cb(), ossl_pem_passwd_cb(), ossl_pkcs12_initialize(), ossl_protect_membio2str(), ossl_protect_obj2bio(), ossl_sslctx_session_get_cb(), ossl_sslctx_session_new_cb(), ossl_sslctx_session_remove_cb(), ossl_tmp_dh_callback(), ossl_verify_cb(), parse(), pruby_obj_to_var(), rb_autoload_load(), rb_eval_string_protect(), rb_glob_caller(), rb_hash_fetch_m(), rb_io_s_pipe(), rb_io_s_read(), readline_readline(), ruby_eval_string_from_file_protect(), run_finalizer(), tcl_protect_core(), ttymode(), zstream_expand_buffer(), and zstream_expand_buffer_protect().
| void rb_provide | ( | const char * | ) |
Definition at line 572 of file load.c.
References rb_provide_feature(), and rb_usascii_str_new2.
| int rb_provided | ( | const char * | ) |
Definition at line 523 of file load.c.
References rb_feature_provided().
Definition at line 877 of file random.c.
References CHAR_BIT, genrand_int32(), id_bytes, LONG2NUM, rb_random_t::mt, rb_funcall2, rb_str_new(), RSTRING_PTR, SIZEOF_INT32, and try_get_rnd().
| unsigned int rb_random_int32 | ( | VALUE | rnd | ) |
Definition at line 795 of file random.c.
References genrand_int32(), id_rand, INT2FIX, rb_random_t::mt, NUM2ULONG, rb_big_plus(), rb_funcall2, try_get_rnd(), and ULONG2NUM.
| double rb_random_real | ( | VALUE | rnd | ) |
Definition at line 812 of file random.c.
References genrand_real(), id_rand, rb_random_t::mt, NUM2DBL, rb_eRangeError, rb_funcall2, rb_raise(), and try_get_rnd().
| unsigned long rb_random_ulong_limited | ( | VALUE | rnd, |
| unsigned long | limit | ||
| ) |
Definition at line 843 of file random.c.
References id_rand, limited_rand(), rb_random_t::mt, NUM2ULONG, rb_eRangeError, rb_funcall2, rb_num_negative_p(), rb_raise(), rb_to_int(), try_get_rnd(), and ulong_to_num_plus_1().
Definition at line 1005 of file range.c.
References NUM2LONG, Qfalse, Qnil, Qtrue, rb_eRangeError, rb_raise(), and rb_range_values().
Definition at line 70 of file range.c.
References range, range_init(), rb_cRange, rb_obj_alloc(), and RBOOL.
Definition at line 981 of file range.c.
References EXCL, id_beg, id_end, Qfalse, Qtrue, RANGE_BEG, RANGE_END, rb_cRange, rb_funcall(), rb_intern, rb_obj_is_kind_of(), rb_respond_to(), and RTEST.
Definition at line 1768 of file rational.c.
References nurat_s_convert(), and rb_cRational.
Definition at line 1760 of file rational.c.
References nurat_s_canonicalize_internal(), and rb_cRational.
Definition at line 1754 of file rational.c.
References nurat_s_new_internal(), and rb_cRational.
Definition at line 1694 of file rational.c.
References CLASS_OF, f_rational_new_no_reduce2(), and get_dat1.
Definition at line 3620 of file file.c.
References chompdirsep(), FilePathValue, Inc, NIL_P, NULL, OBJ_TAINT, Qnil, rb_dir_getwd(), rb_enc_get(), rb_hash_new(), rb_secure(), rb_str_dup_frozen, rb_str_set_len(), rb_str_subseq(), realpath_rec(), RSTRING_GETMEM, and skipprefixroot().
Definition at line 1177 of file eval.c.
References CONST_ID, and rb_attr_get().
Referenced by include_modules_at(), rb_method_entry_make(), and rb_mod_to_s().
| VALUE rb_reg_alloc | ( | void | ) |
Definition at line 2499 of file re.c.
References rb_reg_s_alloc().
Definition at line 1100 of file re.c.
References match_backref_number().
Definition at line 2325 of file re.c.
References buf, err, Qnil, rb_enc_get(), RB_GC_GUARD, rb_reg_error_desc(), rb_reg_preprocess(), RSTRING_LEN, RSTRING_PTR, and StringValue.
Definition at line 2548 of file re.c.
References err, FL_SET, Qnil, rb_reg_alloc(), rb_reg_error_desc(), rb_reg_initialize_str(), rb_set_errinfo(), rb_str_new(), and REG_LITERAL.
Definition at line 2511 of file re.c.
References err, NULL, rb_reg_initialize_str(), and rb_reg_raise_str().
Definition at line 1509 of file re.c.
References rb_reg_nth_match().
Definition at line 2765 of file re.c.
References LONG2FIX, Qnil, rb_str_sublen(), and reg_match_pos().
Definition at line 2824 of file re.c.
References LONG2FIX, Qnil, rb_backref_set(), rb_lastline_get(), rb_reg_search(), rb_str_sublen(), RB_TYPE_P, and T_STRING.
Definition at line 1572 of file re.c.
References BEG, match_check(), NIL_P, re_registers::num_regs, Qnil, rb_reg_nth_match(), and RMATCH_REGS.
Definition at line 1554 of file re.c.
References BEG, END, match_check(), NIL_P, OBJ_TAINT, OBJ_TAINTED, Qnil, rb_str_subseq(), RMATCH, RMATCH_REGS, and RSTRING_LEN.
Definition at line 1527 of file re.c.
References BEG, match_check(), NIL_P, OBJ_TAINT, OBJ_TAINTED, Qnil, rb_str_subseq(), RMATCH, and RMATCH_REGS.
Definition at line 2542 of file re.c.
References rb_ascii8bit_encoding(), and rb_enc_reg_new().
Definition at line 2505 of file re.c.
References rb_reg_alloc(), and rb_reg_init_str().
Definition at line 1465 of file re.c.
References BEG, match_check(), NIL_P, re_registers::num_regs, Qfalse, Qnil, Qtrue, and RMATCH_REGS.
Definition at line 1483 of file re.c.
References BEG, END, re_registers::end, match_check(), NIL_P, re_registers::num_regs, OBJ_INFECT, Qnil, rb_str_subseq(), RMATCH, and RMATCH_REGS.
| int rb_reg_options | ( | VALUE | ) |
Definition at line 3102 of file re.c.
References ARG_ENCODING_FIXED, ARG_ENCODING_NONE, ARG_REG_OPTION_MASK, KCODE_FIXED, options(), rb_reg_check(), RBASIC, REG_ENCODING_NONE, and RREGEXP.
| int rb_remove_event_hook | ( | rb_event_hook_func_t | func | ) |
Definition at line 204 of file vm_trace.c.
References GET_VM, Qundef, and remove_event_hook().
Definition at line 755 of file vm_method.c.
References rb_intern, and remove_method().
Definition at line 749 of file vm_method.c.
References remove_method().
Definition at line 1034 of file load.c.
References OBJ_FREEZE, rb_require_safe(), rb_safe_level, and rb_str_new2.
Definition at line 943 of file load.c.
References rb_thread_struct::errinfo, EXEC_TAG, FilePathValue, GET_THREAD(), JUMP_TAG, load_ext(), load_failed(), load_lock(), load_unlock(), LONG2NUM, NIL_P, POP_TAG, PUSH_TAG, Qfalse, Qnil, Qtrue, rb_ary_push(), rb_load_internal(), rb_provide_feature(), rb_safe_level, rb_set_safe_level_force(), rb_sourcefile, rb_sourceline(), rb_str_encode_ospath(), rb_vm_call_cfunc(), rb_vm_top_self(), result, RSTRING_PTR, ruby_dln_librefs, RUBY_DTRACE_FIND_REQUIRE_ENTRY, RUBY_DTRACE_FIND_REQUIRE_ENTRY_ENABLED, RUBY_DTRACE_FIND_REQUIRE_RETURN, RUBY_DTRACE_FIND_REQUIRE_RETURN_ENABLED, RUBY_DTRACE_REQUIRE_ENTRY, RUBY_DTRACE_REQUIRE_ENTRY_ENABLED, RUBY_DTRACE_REQUIRE_RETURN, RUBY_DTRACE_REQUIRE_RETURN_ENABLED, search_required(), and StringValuePtr.
Definition at line 799 of file eval.c.
References rb_eStandardError, and rb_rescue2().
Referenced by cmp_equal(), do_coerce(), range_init(), and time_mload().
Definition at line 741 of file eval.c.
References rb_thread_struct::cfp, rb_thread_struct::errinfo, FALSE, GET_THREAD(), JUMP_TAG, Qfalse, Qnil, rb_obj_is_kind_of(), rb_vm_rewind_cfp(), result, TAG_RAISE, TAG_RETRY, TH_EXEC_TAG, TH_POP_TAG, TH_PUSH_TAG, TRUE, and va_init_list.
Referenced by argf_getpartial(), check_funcall_missing(), copy_stream_fallback(), gzfile_read_raw(), io_close(), lazy_zip_func(), path_unlink(), rb_f_loop(), rb_rescue(), tcl2rb_num_or_str(), tkstr_rescue_float(), tkstr_to_number(), and zip_i().
| int rb_reserved_fd_p | ( | int | fd | ) |
Definition at line 17570 of file ripper.c.
References reserved_word().
| void rb_reset_random_seed | ( | void | ) |
Definition at line 1323 of file random.c.
References default_rand, INT2FIX, rb_random_t::mt, rb_random_t::seed, and uninit_genrand.
Definition at line 1638 of file vm_method.c.
References FALSE, and rb_obj_respond_to().
| VALUE* rb_ruby_debug_ptr | ( | void | ) |
Definition at line 2828 of file vm.c.
References GET_VM, and ruby_vm_debug_ptr().
| VALUE* rb_ruby_verbose_ptr | ( | void | ) |
Definition at line 2822 of file vm.c.
References GET_VM, and ruby_vm_verbose_ptr().
| int rb_safe_level | ( | void | ) |
Definition at line 37 of file safe.c.
References GET_THREAD(), and rb_thread_struct::safe_level.
| void rb_secure | ( | int | ) |
Definition at line 88 of file safe.c.
References rb_eSecurityError, rb_frame_callee(), rb_id2name(), rb_raise(), and rb_safe_level.
Definition at line 316 of file variable.c.
References classid, classpath, ID2SYM, OBJ_FREEZE, rb_cObject, rb_intern, rb_ivar_set(), rb_str_cat2(), rb_str_dup(), rb_str_new2, rb_tmp_class_path(), and tmp_classpath.
Definition at line 293 of file variable.c.
References classid, classpath, ID2SYM, OBJ_FREEZE, rb_cObject, rb_intern_str, rb_ivar_set(), rb_str_append(), rb_str_cat2(), rb_str_dup(), rb_str_new_frozen(), rb_tmp_class_path(), and tmp_classpath.
Definition at line 60 of file eval_jump.c.
References ALLOC, end_proc_data::data, end_procs, ephemeral_end_procs, end_proc_data::func, func, GET_THREAD(), link(), list, end_proc_data::next, rb_safe_level, end_proc_data::safe, and rb_thread_struct::top_wrapper.
Referenced by Init_tcltklib(), m_core_set_postexe(), and rb_f_at_exit().
| void rb_set_errinfo | ( | VALUE | ) |
Definition at line 1504 of file eval.c.
References err, rb_thread_struct::errinfo, GET_THREAD(), NIL_P, rb_eException, rb_eTypeError, rb_obj_is_kind_of(), and rb_raise().
Referenced by exc_equal(), load_encoding(), name_err_mesg_to_str(), ossl_pem_passwd_cb(), ossl_verify_cb(), pruby_eval(), rb_reg_compile(), reg_compile_gen(), and run_finalizer().
| void rb_set_safe_level | ( | int | ) |
Definition at line 49 of file safe.c.
References GET_THREAD(), rb_eArgError, rb_raise(), rb_thread_struct::safe_level, and SAFE_LEVEL_MAX.
| void rb_set_safe_level_force | ( | int | ) |
Definition at line 43 of file safe.c.
References GET_THREAD(), and rb_thread_struct::safe_level.
| int rb_sigaltstack_size | ( | void | ) |
| const char* rb_sourcefile | ( | void | ) |
Definition at line 952 of file vm.c.
References rb_thread_struct::cfp, GET_THREAD(), rb_control_frame_struct::iseq, rb_iseq_struct::location, rb_iseq_location_struct::path, rb_vm_get_ruby_level_next_cfp(), and RSTRING_PTR.
| VALUE rb_sourcefilename | ( | void | ) |
Definition at line 938 of file vm.c.
References rb_thread_struct::cfp, GET_THREAD(), rb_control_frame_struct::iseq, rb_iseq_struct::location, rb_iseq_location_struct::path, Qnil, and rb_vm_get_ruby_level_next_cfp().
| int rb_sourceline | ( | void | ) |
Definition at line 966 of file vm.c.
References rb_thread_struct::cfp, GET_THREAD(), rb_vm_get_ruby_level_next_cfp(), and rb_vm_get_sourceline().
| rb_pid_t rb_spawn | ( | int | , |
| VALUE * | |||
| ) |
Definition at line 3833 of file process.c.
References NULL, and rb_spawn_internal().
| rb_pid_t rb_spawn_err | ( | int | , |
| VALUE * | , | ||
| char * | , | ||
| size_t | |||
| ) |
Definition at line 3827 of file process.c.
References rb_spawn_internal().
|
inlinestatic |
Definition at line 1687 of file ruby.h.
References Qfalse, Qtrue, and SPECIAL_CONST_P.
Definition at line 2633 of file variable.c.
References st_copy(), st_data_t, st_foreach(), and tbl_copy_i().
Definition at line 2618 of file variable.c.
References Qundef, RB_OBJ_WRITTEN, result, st_data_t, and st_insert().
| void rb_stdio_set_default_encoding | ( | void | ) |
Definition at line 4231 of file bignum.c.
References bignorm(), maxpow_in_bdigit_dbl(), rb_eArgError, RB_GC_GUARD, rb_must_asciicompat(), rb_raise(), roomof, str2big_karatsuba(), str2big_scan_digits(), and StringValueCStr.
Definition at line 4192 of file bignum.c.
References bignorm(), maxpow_in_bdigit_dbl(), rb_eArgError, RB_GC_GUARD, rb_must_asciicompat(), rb_raise(), roomof, str2big_normal(), str2big_scan_digits(), and StringValueCStr.
Definition at line 4159 of file bignum.c.
References bignorm(), bit_length, POW2_P, rb_eArgError, RB_GC_GUARD, rb_must_asciicompat(), rb_raise(), str2big_poweroftwo(), str2big_scan_digits(), and StringValueCStr.
Definition at line 4377 of file bignum.c.
References rb_str_to_inum().
Definition at line 2298 of file string.c.
References ENC_CODERANGE, ENC_CODERANGE_SET, OBJ_INFECT, rb_enc_associate(), rb_enc_check(), rb_enc_mbminlen, rb_str_buf_append(), rb_str_modify_expand(), RSTRING, RSTRING_LEN, RSTRING_PTR, STR_ASSOC_P, StringValue, and TERM_FILL.
Definition at line 1539 of file string.c.
References FL_SET, rb_ary_concat(), rb_check_frozen, RB_OBJ_WRITE, RBASIC_CLEAR_CLASS, RESIZE_CAPA, RSTRING, RSTRING_LEN, STR_ASSOC, STR_ASSOC_P, STR_EMBED_P, str_make_independent, and STR_SHARED_P.
Definition at line 1570 of file string.c.
References Qfalse, RSTRING, STR_ASSOC_P, and STR_SHARED_P.
Definition at line 2282 of file string.c.
References ENC_CODERANGE, ENC_CODERANGE_SET, ENCODING_GET, OBJ_INFECT, rb_enc_cr_str_buf_cat(), RSTRING_LEN, and RSTRING_PTR.
Definition at line 2124 of file string.c.
References rb_eArgError, rb_raise(), and str_buf_cat().
Definition at line 2134 of file string.c.
References rb_str_buf_cat(), and strlen().
Definition at line 2258 of file string.c.
References ALLOCA_N, buf, c, ENC_CODERANGE_7BIT, ENC_CODERANGE_VALID, ENCODING_GET, rb_enc_asciicompat, rb_enc_codelen(), rb_enc_cr_str_buf_cat(), rb_enc_from_index(), rb_enc_mbcput, rb_enc_mbmaxlen, and strlen().
| int rb_str_buf_cat_escaped_char | ( | VALUE | result, |
| unsigned int | c, | ||
| int | unicode_p | ||
| ) |
Definition at line 4747 of file string.c.
References buf, CHAR_ESC_LEN, ISPRINT, rb_str_buf_cat(), snprintf, and strlen().
| VALUE rb_str_buf_new | ( | long | ) |
Definition at line 891 of file string.c.
References ALLOC_N, FL_SET, rb_cString, RSTRING, str_alloc(), STR_BUF_MIN_SIZE, and STR_NOEMBED.
Definition at line 907 of file string.c.
References rb_str_buf_cat(), rb_str_buf_new(), and strlen().
| size_t rb_str_capacity | ( | VALUE | ) |
Definition at line 468 of file string.c.
References RSTRING, RSTRING_EMBED_LEN_MAX, STR_EMBED_P, and STR_NOCAPA_P.
Definition at line 2140 of file string.c.
References rb_eArgError, rb_raise(), rb_str_buf_cat(), rb_str_modify_expand(), RSTRING, STR_ASSOC_P, TERM_FILL, and TERM_LEN.
Definition at line 2159 of file string.c.
References rb_str_cat(), and strlen().
Definition at line 2486 of file string.c.
References ENCODING_GET, lesser, memcmp(), rb_str_comparable(), and RSTRING_GETMEM.
| long rb_str_coderange_scan_restartable | ( | const char * | , |
| const char * | , | ||
| rb_encoding * | , | ||
| int * | |||
| ) |
Definition at line 340 of file string.c.
References ENC_CODERANGE_7BIT, ENC_CODERANGE_BROKEN, ENC_CODERANGE_UNKNOWN, ENC_CODERANGE_VALID, MBCLEN_CHARFOUND_LEN, MBCLEN_CHARFOUND_P, MBCLEN_INVALID_P, rb_enc_asciicompat, rb_enc_precise_mbclen(), rb_enc_to_index, and search_nonascii().
Definition at line 2461 of file string.c.
References ENC_CODERANGE_7BIT, ENCODING_GET, FALSE, rb_enc_asciicompat, rb_enc_from_index(), rb_enc_str_coderange(), RSTRING_LEN, and TRUE.
Definition at line 2340 of file string.c.
References ALLOCA_N, buf, ENC_CODERANGE, ENC_CODERANGE_7BIT, ENC_CODERANGE_SET, ENC_CODERANGE_VALID, FIX2LONG, FIXNUM_P, ONIGERR_INVALID_CODE_POINT_VALUE, ONIGERR_TOO_BIG_WIDE_CHAR_VALUE, rb_ascii8bit_encoding(), rb_enc_associate(), rb_enc_codelen(), rb_enc_mbcput, rb_enc_name, rb_enc_precise_mbclen(), rb_eRangeError, rb_num_to_uint(), rb_raise(), rb_str_append(), rb_str_cat(), rb_str_resize(), RB_TYPE_P, rb_usascii_encoding(), RSTRING_LEN, RSTRING_PTR, STR_ENC_GET, and T_BIGNUM.
| VALUE rb_str_conv_enc | ( | VALUE | str, |
| rb_encoding * | from, | ||
| rb_encoding * | to | ||
| ) |
Definition at line 680 of file string.c.
References Qnil, and rb_str_conv_enc_opts().
| VALUE rb_str_conv_enc_opts | ( | VALUE | str, |
| rb_encoding * | from, | ||
| rb_encoding * | to, | ||
| int | ecflags, | ||
| VALUE | ecopts | ||
| ) |
Definition at line 607 of file string.c.
References DATA_PTR, dp, econv_destination_buffer_full, econv_finished, is_ascii_string, LONG_MAX, OnigEncodingTypeST::name, OBJ_INFECT, rb_ascii8bit_encoding(), rb_cEncodingConverter, rb_econv_close(), rb_econv_convert(), rb_econv_open_opts(), rb_enc_asciicompat, rb_enc_associate(), rb_enc_get(), rb_gc_force_recycle(), rb_obj_alloc(), rb_str_dup(), rb_str_new(), rb_str_resize(), rb_str_set_len(), RBASIC_CLEAR_CLASS, RSTRING_LEN, RSTRING_PTR, and STR_ENC_GET.
Definition at line 3635 of file string.c.
References ELTS_SHARED, ENC_CODERANGE_CLEAR, memmove(), rb_str_new4, RBASIC, RSTRING, RSTRING_EMBED_LEN_MAX, RSTRING_LEN, RSTRING_PTR, str_modifiable(), STR_NOEMBED, STR_SET_EMBED, STR_SET_EMBED_LEN, STR_SHARED_P, and xfree.
Definition at line 4899 of file string.c.
References c, ENC_CODERANGE_7BIT, ENC_CODERANGE_SET, IS_EVSTR, ISPRINT, MBCLEN_CHARFOUND_LEN, MBCLEN_CHARFOUND_P, OnigEncodingTypeST::name, OBJ_INFECT, rb_ascii8bit_encoding(), rb_enc_asciicompat, rb_enc_associate(), rb_enc_get(), rb_enc_mbc_to_codepoint, rb_enc_precise_mbclen(), rb_str_new5, rb_utf8_encoding(), result, RSTRING_LEN, RSTRING_PTR, snprintf, and strlen().
Definition at line 1062 of file string.c.
References rb_obj_class(), and str_duplicate().
Shortens str and adds three dots, an ellipsis, if it is longer than len characters.
| str | the string to ellipsize. |
| len | the maximum string length. |
Definition at line 7969 of file string.c.
References Qnil, rb_eIndexError, rb_enc_asciicompat, rb_enc_associate(), rb_enc_from_encoding(), rb_enc_get(), rb_enc_mbminlen, rb_enc_nth(), rb_enc_step_back, rb_raise(), rb_str_append(), rb_str_cat(), rb_str_encode(), rb_str_new_with_class(), rb_str_subseq(), rb_usascii_str_new(), RSTRING_LEN, and RSTRING_PTR.
Definition at line 2885 of file transcode.c.
References argc, argv, encoded_dup(), and str_transcode0().
Definition at line 231 of file file.c.
References NULL, rb_ascii8bit_encoding(), rb_enc_get(), rb_filesystem_encoding(), rb_str_conv_enc(), and rb_utf8_encoding().
Definition at line 2543 of file string.c.
References Qfalse, Qtrue, rb_equal(), rb_intern, rb_respond_to(), RB_TYPE_P, str_eql(), and T_STRING.
Definition at line 743 of file string.c.
References rb_default_external_encoding(), rb_str_conv_enc(), and STR_ENC_GET.
Definition at line 749 of file string.c.
References rb_locale_encoding(), rb_str_conv_enc(), and STR_ENC_GET.
| VALUE rb_str_export_to_enc | ( | VALUE | , |
| rb_encoding * | |||
| ) |
Definition at line 755 of file string.c.
References rb_str_conv_enc(), and STR_ENC_GET.
Definition at line 1670 of file string.c.
References rb_enc_get(), rb_enc_mbminlen, RSTRING_LEN, RSTRING_PTR, and str_fill_term().
Definition at line 421 of file sprintf.c.
References arg, argc, argv, BIT_DIGITS, buf, c, CHAR_BIT, CHECK, CHECK_FOR_FLAGS, CHECK_FOR_WIDTH, ENC_CODERANGE_7BIT, ENC_CODERANGE_BROKEN, ENC_CODERANGE_SET, ENC_CODERANGE_UNKNOWN, expr, ffs(), FILL, FIX2LONG, FIXABLE, FIXNUM_P, FMINUS, fmt_setup(), FNONE, FPLUS, FPREC, FPREC0, FSHARP, FSPACE, FWIDTH, FZERO, GETARG, GETASTER, GETNAMEARG, GETNUM, GETPOSARG, hash(), ID2SYM, INTEGER_PACK_2COMP, INTEGER_PACK_BIG_ENDIAN, isinf(), isnan, LONG2FIX, NIL_P, NULL, NUM2INT, OBJ_TAINT, OBJ_TAINTED, PRIdSIZE, PUSH, Qundef, rb_absint_numwords(), rb_absint_singlebit_p(), rb_big2str(), rb_check_id_cstr(), rb_check_string_type(), rb_dbl2big(), rb_eArgError, rb_eKeyError, rb_enc_associate(), rb_enc_check(), rb_enc_codelen(), rb_enc_codepoint_len(), rb_enc_copy(), rb_enc_get(), rb_enc_isprint, rb_enc_mbclen(), rb_enc_mbcput, rb_enc_nth(), rb_enc_raise(), rb_enc_right_char_head, rb_enc_strlen(), rb_enc_toupper(), rb_Float(), RB_GC_GUARD, rb_id2name(), rb_inspect(), rb_Integer(), rb_integer_pack(), rb_long2int, rb_obj_as_string(), rb_raise(), rb_str_buf_new(), rb_str_coderange_scan_restartable(), rb_str_new(), rb_str_new4, rb_str_resize(), rb_str_set_len(), rb_str_to_inum(), rb_warn(), RBIGNUM_NEGATIVE_P, result, RFLOAT_VALUE, RSTRING_END, RSTRING_LEN, RSTRING_PTR, RTEST, ruby_debug, ruby_digitmap, ruby_verbose, sign_bits(), snprintf, StringValue, strlen(), T_BIGNUM, T_FIXNUM, T_FLOAT, T_STRING, TRUE, TYPE, and val.
| void rb_str_free | ( | VALUE | ) |
Definition at line 941 of file string.c.
References FL_TEST, NULL, RSTRING_FSTR, ruby_sized_xfree(), st_data_t, st_delete(), STR_EMBED_P, STR_HEAP_PTR, STR_HEAP_SIZE, and STR_SHARED_P.
Definition at line 1968 of file string.c.
References OBJ_FREEZE, rb_obj_freeze(), RSTRING, and STR_ASSOC_P.
| st_index_t rb_str_hash | ( | VALUE | ) |
Definition at line 2422 of file string.c.
References ENC_CODERANGE_7BIT, ENCODING_GET, rb_enc_str_coderange(), rb_memhash(), RSTRING_LEN, and RSTRING_PTR.
Definition at line 2432 of file string.c.
References memcmp(), rb_str_comparable(), RSTRING_LEN, and RSTRING_PTR.
Definition at line 4792 of file string.c.
References buf, c, CHAR_ESC_LEN, ENCODING_GET, get_actual_encoding(), ISPRINT, MBCLEN_CHARFOUND_LEN, MBCLEN_CHARFOUND_P, NULL, OBJ_INFECT, rb_default_external_encoding(), rb_default_internal_encoding(), rb_enc_asciicompat, rb_enc_associate(), rb_enc_codepoint, rb_enc_from_index(), rb_enc_isascii, rb_enc_isprint, rb_enc_mbc_to_codepoint, rb_enc_mbminlen, rb_enc_precise_mbclen(), rb_enc_unicode_p(), rb_str_buf_cat_escaped_char(), rb_str_buf_new(), rb_usascii_encoding(), result, RSTRING_END, RSTRING_PTR, snprintf, str_buf_cat(), str_buf_cat2, and strlen().
Definition at line 7467 of file string.c.
References id, ID2SYM, RB_GC_GUARD, and rb_intern_str.
Definition at line 1298 of file string.c.
References LONG2NUM, STR_ENC_GET, and str_strlen().
Definition at line 2001 of file string.c.
References func, rb_ensure(), rb_str_locktmp(), and rb_str_unlocktmp().
| void rb_str_modify | ( | VALUE | ) |
Definition at line 1484 of file string.c.
References ENC_CODERANGE_CLEAR, str_independent(), and str_make_independent.
| void rb_str_modify_expand | ( | VALUE | , |
| long | |||
| ) |
Definition at line 1492 of file string.c.
References ENC_CODERANGE_CLEAR, rb_eArgError, rb_raise(), REALLOC_N, RSTRING, RSTRING_EMBED_LEN_MAX, RSTRING_LEN, STR_EMBED_P, str_independent(), str_make_independent_expand(), STR_UNSET_NOCAPA, and TERM_LEN.
Definition at line 534 of file string.c.
References rb_cString, and str_new().
Definition at line 560 of file string.c.
References rb_eArgError, rb_raise(), rb_str_new(), and strlen().
Definition at line 833 of file string.c.
References assert, ENCODING_GET, FL_SET, FL_TAINT, FL_UNSET, OBJ_FREEZE, OBJ_FROZEN, OBJ_INFECT, rb_enc_cr_str_exact_copy(), rb_obj_class(), RB_OBJ_WRITE, RBASIC, RSTRING, RSTRING_LEN, RSTRING_PTR, STR_ASSOC, STR_ASSOC_P, STR_EMBED_P, str_new(), str_new3(), str_new4(), and STR_SHARED_P.
Definition at line 799 of file string.c.
References OBJ_INFECT, rb_obj_class(), and str_new3().
Definition at line 874 of file string.c.
References rb_obj_class(), and str_new().
| long rb_str_offset | ( | VALUE | , |
| long | |||
| ) |
Definition at line 1781 of file string.c.
References RSTRING_END, RSTRING_PTR, single_byte_optimizable(), STR_ENC_GET, and str_offset().
Definition at line 1352 of file string.c.
References ENC_CODERANGE, ENC_CODERANGE_AND, ENCODING_CODERANGE_SET, OBJ_TAINT, OBJ_TAINTED, rb_enc_check(), rb_enc_to_index, rb_str_new(), RSTRING_LEN, RSTRING_PTR, and StringValue.
Definition at line 8400 of file string.c.
References Check_Type, NULL, rb_default_external_encoding(), rb_default_internal_encoding(), rb_str_inspect(), rb_str_is_ascii_only_p(), RSTRING_LEN, RSTRING_PTR, STR_ENC_GET, sym_printable(), and T_STRING.
Definition at line 4314 of file string.c.
References str_discard(), str_modifiable(), str_replace(), and StringValue.
Definition at line 2025 of file string.c.
References ENC_CODERANGE_CLEAR, MEMCPY, rb_eArgError, rb_raise(), REALLOC_N, RSTRING, RSTRING_EMBED_LEN_MAX, RSTRING_LEN, ruby_xfree(), STR_EMBED_P, STR_HEAP_PTR, str_independent(), str_make_independent_expand(), STR_SET_EMBED, STR_SET_EMBED_LEN, STR_SET_NOEMBED, TERM_FILL, and TERM_LEN.
Definition at line 1068 of file string.c.
References rb_cString, rb_sourcefile, rb_sourceline(), RSTRING_LEN, RUBY_DTRACE_STRING_CREATE, RUBY_DTRACE_STRING_CREATE_ENABLED, and str_duplicate().
| str | the string to be scrubbed |
| repl | the replacement character |
Definition at line 8037 of file string.c.
References buf, DEFAULT_REPLACE_CHAR, ENC_CODERANGE, ENC_CODERANGE_7BIT, ENC_CODERANGE_SET, ENC_CODERANGE_VALID, ENCODING_CODERANGE_SET, FALSE, MBCLEN_CHARFOUND_LEN, MBCLEN_CHARFOUND_P, MBCLEN_INVALID_P, MBCLEN_NEEDMORE_P, NIL_P, NULL, Qnil, rb_block_given_p(), rb_enc_asciicompat, rb_enc_dummy_p(), rb_enc_mbmaxlen, rb_enc_mbminlen, rb_enc_precise_mbclen(), rb_enc_str_new(), rb_enc_to_index, rb_str_buf_cat(), rb_str_buf_new(), rb_utf8_encindex, rb_yield(), RSTRING_END, RSTRING_LEN, RSTRING_PTR, search_nonascii(), str_compat_and_valid(), STR_ENC_GET, TRUE, and UNREACHABLE.
| void rb_str_set_len | ( | VALUE | , |
| long | |||
| ) |
Definition at line 2008 of file string.c.
References rb_bug(), rb_eRuntimeError, rb_raise(), rb_str_capacity(), RSTRING_PTR, str_modifiable(), STR_SET_LEN, STR_SHARED_P, TERM_FILL, and TERM_LEN.
Definition at line 7875 of file string.c.
References NIL_P, rb_eTypeError, rb_id2name(), rb_raise(), RB_TYPE_P, and T_STRING.
Definition at line 972 of file string.c.
References ENC_CODERANGE, ENC_CODERANGE_SET, FL_SET, OBJ_INFECT, rb_enc_associate(), RB_OBJ_WRITE, RBASIC, RSTRING, RSTRING_EMBED_LEN_MAX, RSTRING_LEN, RSTRING_PTR, str_discard(), STR_ENC_GET, STR_NOCAPA, STR_NOCAPA_P, STR_SET_EMBED, STR_SET_EMBED_LEN, STR_SET_NOEMBED, and STR_UNSET_NOCAPA.
Definition at line 6411 of file string.c.
References rb_str_new2, rb_str_split_m(), and StringValue.
| long rb_str_strlen | ( | VALUE | ) |
Definition at line 1284 of file string.c.
References STR_ENC_GET, and str_strlen().
| long rb_str_sublen | ( | VALUE | , |
| long | |||
| ) |
Definition at line 1828 of file string.c.
References ENC_CODERANGE, enc_strlen(), RSTRING_PTR, single_byte_optimizable(), and STR_ENC_GET.
| char* rb_str_subpos | ( | VALUE | , |
| long | , | ||
| long * | |||
| ) |
Definition at line 1860 of file string.c.
References ENC_CODERANGE, ENC_CODERANGE_VALID, rb_enc_mbmaxlen, rb_enc_mbminlen, rb_enc_prev_char, RB_GC_GUARD, rb_utf8_encoding(), RSTRING_LEN, RSTRING_PTR, single_byte_optimizable(), STR_ENC_GET, str_nth_len(), str_offset(), and str_strlen().
Definition at line 1839 of file string.c.
References OBJ_INFECT, rb_enc_cr_str_copy_for_substr(), RB_GC_GUARD, rb_str_drop_bytes(), rb_str_new5, rb_str_new_frozen(), rb_str_new_shared(), RSTRING_EMBED_LEN_MAX, RSTRING_LEN, and RSTRING_PTR.
Definition at line 1945 of file string.c.
References OBJ_INFECT, Qnil, rb_enc_cr_str_copy_for_substr(), RB_GC_GUARD, rb_obj_class(), rb_str_new4, rb_str_new5, rb_str_subpos(), RSTRING, RSTRING_EMBED_LEN_MAX, RSTRING_END, and str_new3().
Definition at line 3257 of file string.c.
References enc_succ_alnum_char(), enc_succ_char(), ISALPHA, ISDIGIT, MEMCPY, memmove(), NEIGHBOR_FOUND, NEIGHBOR_NOT_CHAR, NEIGHBOR_WRAPPED, OBJ_INFECT, ONIGENC_CODE_TO_MBC_MAXLEN, ONIGENC_MBCLEN_CHARFOUND_LEN, ONIGENC_MBCLEN_CHARFOUND_P, rb_enc_asciicompat, rb_enc_cr_str_copy_for_substr(), rb_enc_precise_mbclen(), rb_enc_prev_char, rb_enc_str_coderange(), rb_str_new5, RESIZE_CAPA, RSTRING_LEN, RSTRING_PTR, STR_ENC_GET, and STR_SET_LEN.
| int rb_str_symname_p | ( | VALUE | ) |
Definition at line 8381 of file string.c.
References FALSE, NULL, rb_default_external_encoding(), rb_default_internal_encoding(), rb_enc_symname_p(), rb_str_is_ascii_only_p(), RSTRING_LEN, RSTRING_PTR, STR_ENC_GET, strlen(), sym_printable(), and TRUE.
Definition at line 1384 of file string.c.
References LONG_MAX, NUM2LONG, OBJ_INFECT, rb_eArgError, rb_enc_cr_str_copy_for_substr(), rb_raise(), rb_str_new5, RSTRING_LEN, and RSTRING_PTR.
| double rb_str_to_dbl | ( | VALUE | , |
| int | |||
| ) |
Definition at line 2868 of file object.c.
References ALLOCV, ALLOCV_END, MEMCPY, rb_cstr_to_dbl(), rb_eArgError, rb_raise(), RSTRING_LEN, RSTRING_PTR, and StringValue.
Definition at line 4127 of file bignum.c.
References ALLOCV, ALLOCV_END, MEMCPY, rb_cstr_to_inum(), rb_must_asciicompat(), RSTRING_LEN, RSTRING_PTR, StringValue, and StringValueCStr.
Referenced by fun1(), obj2int(), obj2subsecx(), obj2vint(), rb_convert_to_integer(), rb_str2inum(), rb_str_format(), rb_str_hex(), rb_str_oct(), rb_str_to_i(), rb_str_upto(), and usec2subsecx().
Definition at line 964 of file string.c.
References rb_convert_type(), and T_STRING.
Definition at line 1991 of file string.c.
References FL_TEST, FL_UNSET, rb_eRuntimeError, rb_raise(), and STR_TMPLOCK.
Definition at line 3739 of file string.c.
References rb_str_splice().
Definition at line 1263 of file sprintf.c.
References __SSTR, __SWR, BSD_vfprintf(), f, rb_str_capacity(), rb_str_modify(), rb_str_resize(), RBASIC, RBASIC_CLEAR_CLASS, RBASIC_SET_CLASS_RAW, RSTRING_END, RSTRING_PTR, ruby__sfvextra(), ruby__sfvwrite(), StringValue, and rb_printf_buffer_extra::value.
Definition at line 2987 of file object.c.
References NIL_P, rb_check_string_type(), rb_convert_type(), and T_STRING.
Definition at line 1589 of file string.c.
References rb_str_to_str(), RB_TYPE_P, and T_STRING.
| char* rb_string_value_cstr | ( | volatile VALUE * | ) |
Definition at line 1644 of file string.c.
References rb_eArgError, rb_enc_get(), rb_enc_mbminlen, rb_raise(), rb_str_modify(), rb_string_value(), RSTRING_LEN, RSTRING_PTR, str_fill_term(), and str_null_char().
| char* rb_string_value_ptr | ( | volatile VALUE * | ) |
Definition at line 1600 of file string.c.
References rb_string_value(), and RSTRING_PTR.
Definition at line 494 of file struct.c.
References RARRAY_LENINT, RARRAY_PTR, and rb_class_new_instance().
Definition at line 235 of file struct.c.
References struct_alloc().
Definition at line 757 of file struct.c.
References NUM2LONG, PRIsVALUE, QUOTE, rb_check_id(), rb_eIndexError, rb_name_error_str(), rb_raise(), rb_struct_aref_id(), RB_TYPE_P, RSTRUCT_GET, RSTRUCT_LEN, SYM2ID, T_STRING, and T_SYMBOL.
Definition at line 827 of file struct.c.
References NUM2LONG, PRIsVALUE, QUOTE, rb_check_id(), rb_eIndexError, rb_name_error_str(), rb_raise(), rb_struct_aset_id(), rb_struct_modify(), RB_TYPE_P, RSTRUCT_LEN, RSTRUCT_SET, SYM2ID, T_STRING, and T_SYMBOL.
Definition at line 306 of file struct.c.
References anonymous_struct(), ID2SYM, new_struct(), rb_ary_push(), rb_ary_tmp_new(), rb_cStruct, rb_intern, rb_str_new2, and setup_struct().
Definition at line 327 of file struct.c.
References ID2SYM, rb_ary_push(), rb_ary_tmp_new(), rb_cStruct, rb_define_class_under(), rb_intern, and setup_struct().
| VALUE rb_struct_define_without_accessor | ( | const char * | , |
| VALUE | , | ||
| rb_alloc_func_t | , | ||
| ... | |||
| ) |
Definition at line 288 of file struct.c.
References ID2SYM, name, NULL, OBJ_FREEZE, rb_ary_push(), rb_ary_tmp_new(), rb_intern, and struct_define_without_accessor().
| VALUE rb_struct_define_without_accessor_under | ( | VALUE | outer, |
| const char * | class_name, | ||
| VALUE | super, | ||
| rb_alloc_func_t | alloc, | ||
| ... | |||
| ) |
Definition at line 270 of file struct.c.
References ID2SYM, name, NULL, OBJ_FREEZE, rb_ary_push(), rb_ary_tmp_new(), rb_intern, and struct_define_without_accessor().
Definition at line 97 of file struct.c.
References ID2SYM, not_a_member(), RARRAY_AREF, RARRAY_LEN, rb_struct_members(), RSTRUCT_GET, and UNREACHABLE.
Definition at line 707 of file struct.c.
References OBJ_INIT_COPY, rb_eTypeError, rb_raise(), RSTRUCT_GET, RSTRUCT_LEN, and RSTRUCT_SET.
Definition at line 466 of file struct.c.
References RARRAY_CONST_PTR, RARRAY_LENINT, and rb_struct_initialize_m().
Definition at line 53 of file struct.c.
References RARRAY_LEN, rb_eTypeError, rb_obj_class(), rb_raise(), rb_struct_s_members(), and RSTRUCT_LEN.
Definition at line 500 of file struct.c.
References N_REF_FUNC, num_members(), numberof, RARRAY_PTR, rb_ary_tmp_new(), rb_class_new_instance(), rb_long2int, and size.
Definition at line 39 of file struct.c.
References id_members, NIL_P, rb_eTypeError, rb_raise(), RB_TYPE_P, struct_ivar_get(), and T_ARRAY.
Definition at line 388 of file vm_trace.c.
References arg, rb_trace_arg_struct::event, GET_THREAD(), JUMP_TAG, Qnil, rb_threadptr_reset_raised(), rb_threadptr_set_raised(), result, rb_thread_struct::state, TH_EXEC_TAG, TH_POP_TAG, TH_PUSH_TAG, rb_thread_struct::trace_arg, rb_vm_struct::trace_running, and rb_thread_struct::vm.
| VALUE rb_sym_all_symbols | ( | void | ) |
Definition at line 17259 of file ripper.c.
References RString::ary, global_symbols, st_table::num_entries, rb_ary_new2, st_foreach(), symbols::sym_id, and symbols_i().
Referenced by Init_String().
| int rb_sym_interned_p | ( | VALUE | ) |
Definition at line 8478 of file string.c.
References rb_cString, rb_id2str(), str_new3(), and SYM2ID.
| int rb_symname_p | ( | const char * | ) |
Definition at line 16824 of file ripper.c.
References rb_ascii8bit_encoding(), and rb_enc_symname_p().
Definition at line 1947 of file error.c.
References arg, Qnil, rb_str_new2, and rb_syserr_new_str().
Referenced by make_errno_exc(), rb_mod_syserr_fail(), and rb_syserr_fail().
Definition at line 1955 of file error.c.
References get_syserr(), and rb_class_new_instance().
Referenced by make_errno_exc_str(), rb_mod_syserr_fail_str(), rb_syserr_fail_str(), and rb_syserr_new().
| void rb_syswait | ( | rb_pid_t | pid | ) |
Definition at line 3754 of file process.c.
References rb_waitpid().
Definition at line 589 of file string.c.
References OBJ_TAINT, and rb_str_new().
Definition at line 598 of file string.c.
References OBJ_TAINT, and rb_str_new2.
| int rb_thread_alone | ( | void | ) |
Definition at line 2990 of file thread.c.
References GET_THREAD(), thread_debug, and vm_living_thread_num().
| void rb_thread_atfork | ( | void | ) |
Definition at line 3931 of file thread.c.
References GET_THREAD(), rb_thread_struct::join_list, NULL, rb_reset_random_seed(), rb_thread_atfork_internal(), and terminate_atfork_i().
| void rb_thread_atfork_before_exec | ( | void | ) |
Definition at line 3954 of file thread.c.
References rb_thread_atfork_internal(), and terminate_atfork_before_exec_i().
| void rb_thread_check_ints | ( | void | ) |
Definition at line 1139 of file thread.c.
References GET_THREAD(), and RUBY_VM_CHECK_INTS_BLOCKING.
Definition at line 745 of file thread.c.
References rb_cThread, rb_thread_alloc(), and thread_create_core().
| VALUE rb_thread_current | ( | void | ) |
Definition at line 2401 of file thread.c.
References GET_THREAD(), and rb_thread_struct::self.
| void rb_thread_execute_interrupts | ( | VALUE | th | ) |
Definition at line 2026 of file thread.c.
References GetThreadPtr, and rb_threadptr_execute_interrupts().
| void rb_thread_fd_close | ( | int | ) |
Definition at line 2131 of file thread.c.
References GET_THREAD(), st_foreach(), and thread_fd_close_i().
| int rb_thread_fd_select | ( | int | , |
| rb_fdset_t * | , | ||
| rb_fdset_t * | , | ||
| rb_fdset_t * | , | ||
| struct timeval * | |||
| ) |
Definition at line 3576 of file thread.c.
References do_select(), rb_fd_resize, rb_thread_sleep_forever(), and rb_thread_wait_for().
| int rb_thread_fd_writable | ( | int | ) |
Definition at line 3525 of file thread.c.
References rb_thread_wait_fd_rw(), and TRUE.
| int rb_thread_interrupted | ( | VALUE | thval | ) |
Definition at line 1156 of file thread.c.
References GetThreadPtr, and RUBY_VM_INTERRUPTED.
| VALUE rb_thread_io_blocking_region | ( | rb_blocking_function_t * | func, |
| void * | data1, | ||
| int | fd | ||
| ) |
Definition at line 1380 of file thread.c.
References BLOCKING_REGION, errno, EXEC_TAG, FALSE, func, GET_THREAD(), JUMP_TAG, Qundef, RUBY_VM_CHECK_INTS_BLOCKING, TH_POP_TAG, TH_PUSH_TAG, and rb_thread_struct::waiting_fd.
Definition at line 2187 of file thread.c.
References eKillSignal, EXIT_SUCCESS, GET_THREAD(), GetThreadPtr, rb_vm_struct::main_thread, rb_exit(), rb_threadptr_interrupt(), rb_threadptr_pending_interrupt_enque(), rb_threadptr_to_kill(), rb_thread_struct::status, thread_debug, rb_thread_struct::thread_id, THREAD_KILLED, rb_thread_struct::to_kill, and rb_thread_struct::vm.
Definition at line 2761 of file thread.c.
References GetThreadPtr, and threadptr_local_aref().
Definition at line 2854 of file thread.c.
References GetThreadPtr, OBJ_FROZEN, rb_error_frozen(), and threadptr_local_aset().
| VALUE rb_thread_main | ( | void | ) |
Definition at line 2422 of file thread.c.
References GET_THREAD(), rb_vm_struct::main_thread, rb_thread_struct::self, and rb_thread_struct::vm.
| void rb_thread_mark | ( | void * | th | ) |
Definition at line 1979 of file vm.c.
References rb_thread_struct::cfp, rb_thread_struct::errinfo, rb_thread_struct::event_hooks, rb_thread_struct::fiber, rb_thread_struct::first_args, rb_thread_struct::first_proc, GET_THREAD(), rb_control_frame_struct::iseq, rb_control_frame_struct::klass, rb_thread_struct::last_status, rb_thread_struct::local_storage, rb_thread_struct::locking_mutex, rb_thread_struct::machine, rb_thread_struct::mark_stack_len, rb_control_frame_struct::me, NULL, rb_thread_struct::pending_interrupt_mask_stack, rb_thread_struct::pending_interrupt_queue, rb_control_frame_struct::proc, rb_gc_mark(), rb_gc_mark_locations, rb_gc_mark_machine_stack(), rb_mark_method_entry(), rb_mark_tbl(), rb_vm_trace_mark_event_hooks(), rb_thread_struct::regs, rb_thread_struct::root_fiber, rb_thread_struct::root_svar, RUBY_MARK_ENTER, RUBY_MARK_LEAVE, RUBY_MARK_UNLESS_NULL, RUBY_VM_NORMAL_ISEQ_P, RUBY_VM_PREVIOUS_CONTROL_FRAME, rb_iseq_struct::self, rb_control_frame_struct::self, rb_control_frame_struct::sp, rb_thread_struct::stack, rb_thread_struct::stack_end, rb_thread_struct::stack_size, rb_thread_struct::stack_start, rb_thread_struct::stat_insn_usage, rb_thread_struct::thgroup, rb_thread_struct::top_self, rb_thread_struct::top_wrapper, and rb_thread_struct::value.
| void rb_thread_recycle_stack_release | ( | VALUE * | ) |
Definition at line 1957 of file vm.c.
References RECYCLE_MAX, and ruby_xfree().
Definition at line 2318 of file thread.c.
References rb_thread_schedule(), and rb_thread_wakeup().
| void rb_thread_schedule | ( | void | ) |
Definition at line 1187 of file thread.c.
References GET_THREAD(), rb_thread_schedule_limits(), rb_threadptr_execute_interrupts(), RUBY_VM_INTERRUPTED_ANY, and UNLIKELY.
Definition at line 4745 of file thread.c.
References DATA_PTR, GetThreadShieldPtr, Qfalse, Qtrue, rb_mutex_unlock(), and rb_thread_shield_waiting.
| VALUE rb_thread_shield_new | ( | void | ) |
Definition at line 4698 of file thread.c.
References DATA_PTR, rb_cThreadShield, rb_mutex_lock(), and thread_shield_alloc().
Definition at line 4734 of file thread.c.
References GetThreadShieldPtr, Qfalse, Qtrue, rb_mutex_unlock(), and rb_thread_shield_waiting.
Definition at line 4714 of file thread.c.
References DATA_PTR, GET_THREAD(), GetMutexPtr, GetThreadShieldPtr, Qfalse, Qnil, Qtrue, rb_mutex_lock(), rb_mutex_unlock(), rb_thread_shield_waiting, rb_thread_shield_waiting_dec(), rb_thread_shield_waiting_inc(), and rb_mutex_struct::th.
| void rb_thread_sleep | ( | int | ) |
Definition at line 1164 of file thread.c.
References INT2FIX, rb_thread_wait_for(), and rb_time_timeval().
| void rb_thread_sleep_deadly | ( | void | ) |
Definition at line 1076 of file thread.c.
References GET_THREAD(), sleep_forever(), and thread_debug.
| void rb_thread_sleep_forever | ( | void | ) |
Definition at line 1069 of file thread.c.
References GET_THREAD(), sleep_forever(), and thread_debug.
| VALUE rb_thread_stop | ( | void | ) |
Definition at line 2342 of file thread.c.
References Qnil, rb_eThreadError, rb_raise(), rb_thread_alone(), and rb_thread_sleep_deadly().
| void rb_thread_wait_fd | ( | int | ) |
Definition at line 3519 of file thread.c.
References rb_thread_wait_fd_rw().
| void rb_thread_wait_for | ( | struct timeval | ) |
Definition at line 1115 of file thread.c.
References GET_THREAD(), and sleep_timeval().
Definition at line 2272 of file thread.c.
References rb_eThreadError, rb_raise(), rb_thread_wakeup_alive(), and RTEST.
Definition at line 2281 of file thread.c.
References GetThreadPtr, Qnil, rb_threadptr_ready(), rb_thread_struct::status, THREAD_KILLED, THREAD_RUNNABLE, THREAD_STOPPED, and THREAD_STOPPED_FOREVER.
Definition at line 2411 of file time.c.
References time_timeval(), and TRUE.
| VALUE rb_time_nano_new | ( | time_t | , |
| long | |||
| ) |
Definition at line 2305 of file time.c.
References nsec2timew(), and time_new_timew().
| VALUE rb_time_new | ( | time_t | , |
| long | |||
| ) |
Definition at line 2279 of file time.c.
References NDIV, nsec2timew(), rb_eRangeError, rb_raise(), time_new_timew(), and time_object::timew.
Definition at line 2311 of file time.c.
References NIL_P, rb_time_magnify(), time_new_timew(), time_set_utc_offset(), utc_offset_arg(), v2w(), and validate_utc_offset().
Definition at line 3764 of file time.c.
References GetTimeval, rb_warn(), TIME_COPY_GMT, time_new_timew(), TIME_SCALE, time_object::timew, wadd(), and WINT2FIXWV.
Definition at line 2434 of file time.c.
References FALSE, GetTimeval, IsTimeval, time_timespec(), and timew2timespec().
Definition at line 2417 of file time.c.
References FALSE, GetTimeval, IsTimeval, time_timeval(), timew2timespec(), timespec::tv_nsec, timeval::tv_sec, timespec::tv_sec, timeval::tv_usec, TYPEOF_TIMEVAL_TV_SEC, and TYPEOF_TIMEVAL_TV_USEC.
| rb_encoding* rb_to_encoding | ( | VALUE | ) |
Definition at line 219 of file encoding.c.
References enc_check_encoding(), RDATA, and str_to_encoding().
Referenced by decorate_convpath(), dir_initialize(), enc_replicate(), enc_set_default_encoding(), int_chr(), rb_io_extract_encoding_option(), rb_str_force_encoding(), and strio_set_encoding().
| int rb_to_encoding_index | ( | VALUE | ) |
Definition at line 171 of file encoding.c.
References enc_check_encoding(), NIL_P, rb_check_string_type(), rb_enc_asciicompat, rb_enc_find_index(), rb_enc_get(), and StringValueCStr.
Referenced by econv_args(), enc_arg(), enc_names(), lib_fromUTF8_core(), rb_io_extract_encoding_option(), and transcode_io().
Definition at line 2941 of file object.c.
References NIL_P, Qfalse, Qtrue, rb_cNumeric, rb_convert_type(), rb_eTypeError, rb_obj_classname(), rb_obj_is_kind_of(), rb_raise(), RB_TYPE_P, and T_FLOAT.
Definition at line 8730 of file string.c.
References NIL_P, PRIsVALUE, rb_check_string_type(), rb_eTypeError, rb_intern_str, rb_raise(), RB_TYPE_P, SYM2ID, SYMBOL_P, and T_STRING.
Definition at line 2680 of file object.c.
References rb_to_integer().
| int rb_tolower | ( | int | c | ) |
Definition at line 1935 of file encoding.c.
References c, ONIGENC_ASCII_CODE_TO_LOWER_CASE, and rb_isascii.
Referenced by readline_attempted_completion_function().
| int rb_toupper | ( | int | c | ) |
Definition at line 1941 of file encoding.c.
References c, ONIGENC_ASCII_CODE_TO_UPPER_CASE, and rb_isascii.
| void rb_trap_exec | ( | void | ) |
| void rb_trap_exit | ( | void | ) |
Definition at line 839 of file signal.c.
References rb_vm_struct::cmd, GET_VM, rb_vm_struct::safe, signal_exec(), and rb_vm_struct::trap_list.
|
inlinestatic |
| int rb_typeddata_inherited_p | ( | const rb_data_type_t * | child, |
| const rb_data_type_t * | parent | ||
| ) |
Definition at line 500 of file error.c.
References rb_data_type_struct::parent.
Referenced by rb_check_typeddata(), and rb_typeddata_is_kind_of().
| int rb_typeddata_is_kind_of | ( | VALUE | , |
| const rb_data_type_t * | |||
| ) |
Definition at line 510 of file error.c.
References RB_TYPE_P, rb_typeddata_inherited_p(), RTYPEDDATA_P, RTYPEDDATA_TYPE, and T_DATA.
Referenced by econv_equal(), is_kind_of_BigDecimal(), rb_backtrace_p(), rb_dlcfunc2ptr(), rb_dlcfunc_kind_p(), rb_obj_is_fiber(), rb_obj_is_method(), rb_obj_is_mutex(), rb_obj_is_proc(), rb_obj_is_thread(), reachable_objects_from(), and try_get_rnd().
Definition at line 3142 of file bignum.c.
References BDIGIT, bdigit_roomof, BDIGITS, BIGDN, BIGLO, bignew, RBIGNUM_SET_LEN, and SIZEOF_VALUE.
Referenced by bigdivrem(), rb_cstr_to_inum(), rb_int2big(), rb_uint2inum(), rb_uint2num_inline(), and rb_ulong2num_inline().
Definition at line 3185 of file bignum.c.
References LONG2FIX, POSFIXABLE, and rb_uint2big().
Referenced by do_checksum(), rb_gzfile_crc(), rb_gzfile_total_in(), rb_gzfile_total_out(), rb_zlib_crc_table(), rb_zstream_adler(), rb_zstream_avail_out(), rb_zstream_total_in(), rb_zstream_total_out(), and zstream_run().
|
inlinestatic |
Definition at line 1291 of file ruby.h.
References LONG2FIX, POSFIXABLE, and rb_uint2big().
|
inlinestatic |
Definition at line 1312 of file ruby.h.
References LONG2FIX, POSFIXABLE, and rb_uint2big().
Definition at line 897 of file vm_method.c.
References attached, rb_method_definition_struct::body, c, CALL_METHOD_HOOK, rb_method_entry_struct::def, FL_SINGLETON, FL_TEST, cache_entry::me, NIL_P, NOEX_PUBLIC, object_id, rb_method_definition_struct::orig_me, PRIsVALUE, QUOTE_ID, rb_add_method(), rb_class_name(), rb_eTypeError, rb_frozen_class_p(), rb_id2name(), rb_ivar_get(), rb_name_error(), rb_raise(), RB_TYPE_P, rb_warn(), search_method(), T_CLASS, T_MODULE, rb_method_definition_struct::type, undefined, UNDEFINED_METHOD_ENTRY_P, VM_METHOD_TYPE_REFINED, and VM_METHOD_TYPE_UNDEF.
| void rb_undef_alloc_func | ( | VALUE | ) |
Definition at line 518 of file vm_method.c.
References rb_define_alloc_func(), and UNDEF_ALLOC_FUNC.
Definition at line 1911 of file gc.c.
References finalizer_table, FL_FINALIZE, FL_UNSET, rb_check_frozen, rb_objspace, st_data_t, and st_delete().
Definition at line 5307 of file thread.c.
References GET_THREAD(), rb_thread_struct::pending_interrupt_mask_stack, rb_ary_pop(), rb_ary_push(), rb_cObject, rb_ensure(), rb_hash_aset(), rb_hash_new(), and sym_never.
| void rb_update_max_fd | ( | int | fd | ) |
Definition at line 183 of file io.c.
References ATOMIC_CAS, errno, fstat, max_file_descriptor, rb_bug(), and stat.
| int rb_usascii_encindex | ( | void | ) |
Definition at line 1266 of file encoding.c.
References rb_usascii_encindex.
| rb_encoding* rb_usascii_encoding | ( | void | ) |
Definition at line 1257 of file encoding.c.
References enc_table, and rb_enc_init().
Referenced by do_opendir(), enc_inspect(), file_path_convert(), Init_id(), intern_str(), mk_inspect(), of2str(), parser_str_new(), push_glob(), rb_ary_join(), rb_external_str_with_enc(), rb_intern2(), rb_nkf_convert(), rb_reg_desc(), rb_reg_initialize(), rb_reg_quote(), rb_reg_to_s(), rb_str_concat(), rb_str_inspect(), rb_str_upto(), rb_strftime_with_timespec(), reg_fragment_setenc_gen(), setup_exception(), time_asctime(), and time_to_s().
Definition at line 540 of file string.c.
References ENC_CODERANGE_7BIT, ENCODING_CODERANGE_SET, rb_str_new(), and rb_usascii_encindex.
Definition at line 569 of file string.c.
References ENC_CODERANGE_7BIT, ENCODING_CODERANGE_SET, rb_str_new2, and rb_usascii_encindex.
| int rb_utf8_encindex | ( | void | ) |
Definition at line 1251 of file encoding.c.
References rb_utf8_encindex.
| rb_encoding* rb_utf8_encoding | ( | void | ) |
Definition at line 1242 of file encoding.c.
References enc_table, and rb_enc_init().
Referenced by alias(), append_utf8(), do_opendir(), env_fetch(), env_str_new(), get_user_from_path(), Init_nkf(), Init_tcltklib(), load_file_internal(), make_econv_exception(), parser_initialize(), parser_prepare(), parser_str_new(), parser_tokadd_utf8(), rb_f_getenv(), rb_file_expand_path_internal(), rb_memsearch(), rb_str_dump(), rb_str_encode_ospath(), rb_str_subpos(), scalar(), start_document(), start_mapping(), start_sequence(), str_strlen(), and transcode_string().
| int rb_uv_to_utf8 | ( | char | [6], |
| unsigned | long | ||
| ) |
Definition at line 1900 of file pack.c.
References castchar, rb_eRangeError, rb_raise(), and UNREACHABLE.
| VALUE rb_vm_backtrace_object | ( | void | ) |
Definition at line 536 of file vm_backtrace.c.
References backtrace_object(), and GET_THREAD().
| void rb_vm_change_state | ( | void | ) |
| const void** rb_vm_get_insns_address_table | ( | void | ) |
Definition at line 118 of file vm_exec.c.
References vm_exec_core().
| void rb_vm_mark | ( | void * | ptr | ) |
Definition at line 1727 of file vm.c.
References rb_vm_struct::cmd, rb_vm_struct::coverages, DEFINED_EXPR, rb_vm_struct::defined_module_hash, rb_vm_struct::defined_strings, rb_vm_struct::event_hooks, rb_vm_struct::expanded_load_path, rb_vm_struct::living_threads, rb_vm_struct::load_path, rb_vm_struct::load_path_check_cache, rb_vm_struct::load_path_snapshot, rb_vm_struct::loaded_features, rb_vm_struct::loaded_features_snapshot, rb_vm_struct::loading_table, rb_vm_struct::mark_object_ary, rb_gc_mark(), rb_gc_mark_locations, rb_mark_tbl(), rb_vm_trace_mark_event_hooks(), RUBY_GC_INFO, RUBY_MARK_ENTER, RUBY_MARK_LEAVE, RUBY_MARK_UNLESS_NULL, RUBY_NSIG, ruby_special_error_count, rb_vm_struct::special_exceptions, st_foreach(), rb_vm_struct::thgroup_default, rb_vm_struct::top_self, rb_vm_struct::trap_list, and vm_mark_each_thread_func().
| void rb_vm_pop_cfunc_frame | ( | void | ) |
Definition at line 281 of file vm.c.
References rb_method_entry_struct::called_id, rb_thread_struct::cfp, EXEC_EVENT_HOOK, GET_THREAD(), rb_method_entry_struct::klass, rb_control_frame_struct::me, Qnil, RUBY_DTRACE_CMETHOD_RETURN_HOOK, RUBY_EVENT_C_RETURN, rb_control_frame_struct::self, and vm_pop_frame().
Definition at line 906 of file vm_backtrace.c.
References thread_backtrace_to_ary().
Definition at line 912 of file vm_backtrace.c.
References thread_backtrace_to_ary().
Definition at line 1244 of file sprintf.c.
References NULL, and rb_enc_vsprintf().
| rb_pid_t rb_waitpid | ( | rb_pid_t | pid, |
| int * | status, | ||
| int | flags | ||
| ) |
Definition at line 758 of file process.c.
References errno, GET_THREAD(), wait_data::pid, rb_eArgError, rb_last_status_set(), rb_raise(), rb_thread_alone(), rb_thread_blocking_region(), rb_thread_call_without_gvl(), rb_thread_schedule(), rb_waitpid_blocking(), result, RUBY_UBF_PROCESS, RUBY_VM_CHECK_INTS, st_data_t, st_delete(), st_foreach(), st_init_numtable(), st_insert(), wait_data::status, and wait_each().
| void rb_write_error | ( | const char * | ) |
Definition at line 7157 of file io.c.
References rb_write_error2(), and strlen().
| void rb_write_error2 | ( | const char * | , |
| long | |||
| ) |
Definition at line 7143 of file io.c.
References rb_io_t::fd, orig_stderr, rb_io_write(), rb_stderr, rb_str_new(), and RFILE.
| void rb_write_error_str | ( | VALUE | mesg | ) |
Definition at line 7163 of file io.c.
References rb_io_t::fd, orig_stderr, RB_GC_GUARD, rb_io_write(), rb_stderr, RFILE, RSTRING_LEN, and RSTRING_PTR.
Definition at line 942 of file vm_eval.c.
References Qundef, and rb_yield_0().
Definition at line 993 of file vm_eval.c.
References rb_proc_t::block, GET_THREAD(), GetProcPtr, NIL_P, and vm_yield_with_block().
Definition at line 981 of file vm_eval.c.
References NIL_P, RARRAY_CONST_PTR, RARRAY_LENINT, rb_check_array_type(), rb_eArgError, rb_raise(), and rb_yield_0().
| VALUE rb_yield_values | ( | int | n, |
| ... | |||
| ) |
Definition at line 953 of file vm_eval.c.
References ALLOCA_N, argv, rb_yield_0(), and va_init_list.
Definition at line 975 of file vm_eval.c.
References rb_yield_0().
|
inlinestatic |
Definition at line 302 of file internal.h.
References ALLOC, RCLASS_M_TBL_WRAPPER, method_table_wrapper::serial, st_init_numtable(), and method_table_wrapper::tbl.
Definition at line 319 of file internal.h.
References rb_class_remove_from_super_subclasses(), rb_class_subclass_add(), RB_OBJ_WRITE, and RCLASS.
Definition at line 313 of file internal.h.
References RCLASS.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
| RUBY_EXTERN double round | ( | double | ) |
| RUBY_EXTERN double round | ( | double | ) |
| int ruby_brace_glob | ( | const char * | , |
| int | , | ||
| ruby_glob_func * | , | ||
| VALUE | |||
| ) |
Definition at line 1713 of file dir.c.
References GLOB_VERBOSE, rb_ascii8bit_encoding(), and ruby_brace_glob0().
Referenced by cmdglob().
| const char* ruby_enc_find_basename | ( | const char * | name, |
| long * | baselen, | ||
| long * | alllen, | ||
| rb_encoding * | enc | ||
| ) |
Definition at line 3772 of file file.c.
References chompdirsep(), Inc, isdirsep, name, skipprefix, strlen(), and strrdirsep.
| const char* ruby_enc_find_extname | ( | const char * | name, |
| long * | len, | ||
| rb_encoding * | enc | ||
| ) |
Definition at line 3965 of file file.c.
References Inc, isdirsep, istrailinggarbage, last, name, strlen(), and strrdirsep.
| void ruby_error_print | ( | void | ) |
| double ruby_float_mod | ( | double | x, |
| double | y | ||
| ) |
Definition at line 907 of file numeric.c.
References flodivmod(), and mod.
| void ruby_gc_set_params | ( | int | safe_level | ) |
Definition at line 5733 of file gc.c.
References gc_set_initial_pages(), get_envparam_double(), get_envparam_int(), ruby_gc_params_t::growth_factor, ruby_gc_params_t::growth_max_slots, ruby_gc_params_t::heap_free_slots, ruby_gc_params_t::heap_init_slots, ruby_gc_params_t::malloc_limit_growth_factor, ruby_gc_params_t::malloc_limit_max, ruby_gc_params_t::malloc_limit_min, rb_objspace::oldmalloc_increase_limit, ruby_gc_params_t::oldmalloc_limit_growth_factor, ruby_gc_params_t::oldmalloc_limit_max, ruby_gc_params_t::oldmalloc_limit_min, ruby_gc_params_t::oldobject_limit_factor, rb_objspace, rb_warn(), and rb_objspace::rgengc.
| int ruby_glob | ( | const char * | , |
| int | , | ||
| ruby_glob_func * | , | ||
| VALUE | |||
| ) |
Definition at line 1578 of file dir.c.
References GLOB_VERBOSE, rb_ascii8bit_encoding(), and ruby_glob0().
| void ruby_kill | ( | rb_pid_t | pid, |
| int | sig | ||
| ) |
Definition at line 5319 of file thread.c.
References err, GET_THREAD(), GVL_UNLOCK_BEGIN, GVL_UNLOCK_END, rb_thread_struct::interrupt_cond, rb_thread_struct::interrupt_lock, kill(), and rb_sys_fail().
Definition at line 1813 of file numeric.c.
References cmp, DBL2NUM, diff(), FIX2LONG, FIXNUM_P, id_cmp, id_div, INFINITY, INT2FIX, isinf(), LONG2FIX, NUM2DBL, POSFIXABLE, rb_cmpint(), rb_dbl2big(), rb_funcall(), rb_num_coerce_cmp(), RB_TYPE_P, result, RTEST, ruby_float_step_size(), T_FLOAT, and ULONG2NUM.
| void ruby_register_rollback_func_for_ensure | ( | VALUE(*)(ANYARGS) | ensure_func, |
| VALUE(*)(ANYARGS) | rollback_func | ||
| ) |
Definition at line 947 of file cont.c.
References GET_VM, NULL, st_data_t, st_init_numtable(), st_insert(), and UNLIKELY.
Referenced by Init_Hash().
| void ruby_set_inplace_mode | ( | const char * | ) |
| const char* ruby_signal_name | ( | int | ) |
Definition at line 254 of file signal.c.
References signo2signm().
| void void ruby_sized_xfree | ( | void * | x, |
| size_t | size | ||
| ) |
Definition at line 6234 of file gc.c.
References objspace_xfree().
| void* ruby_sized_xrealloc | ( | void * | ptr, |
| size_t | new_size, | ||
| size_t | old_size | ||
| ) |
Definition at line 6200 of file gc.c.
References objspace_xrealloc().
| void* ruby_sized_xrealloc2 | ( | void * | ptr, |
| size_t | new_count, | ||
| size_t | element_size, | ||
| size_t | old_count | ||
| ) |
| unsigned long ruby_strtoul | ( | const char * | str, |
| char ** | endptr, | ||
| int | base | ||
| ) |
| int ruby_vsnprintf | ( | char * | str, |
| size_t | n, | ||
| char const * | fmt, | ||
| va_list | ap | ||
| ) |
Definition at line 1302 of file vsnprintf.c.
References __SSTR, __SWR, __sbuf::_base, __sFILE::_bf, __sFILE::_flags, __sFILE::_p, __sbuf::_size, __sFILE::_w, BSD__sfvwrite(), BSD_vfprintf(), EOF, f, __sFILE::vextra, and __sFILE::vwrite.
| RUBY_EXTERN void setproctitle | ( | const char * | fmt, |
| ... | |||
| ) |
Definition at line 135 of file setproctitle.c.
| RUBY_EXTERN void setproctitle | ( | const char * | fmt, |
| ... | |||
| ) |
Definition at line 135 of file setproctitle.c.
References NULL, SPT_PADCHAR, strlcpy(), strlen(), and vsnprintf.
|
static |
| RUBY_EXTERN int signbit | ( | double | x | ) |
| RUBY_EXTERN int signbit | ( | double | x | ) |
Definition at line 629 of file st.c.
References add_direct(), add_packed_direct(), do_hash, st_table::entries_packed, and st_table::num_bins.
Definition at line 830 of file st.c.
References st_table::bins, st_table::entries_packed, st_table_entry::key, last, st_table_entry::next, st_table::num_bins, st_table::num_entries, PACKED_ENT, PKEY, st_table::real_entries, and st_free_entry.
| void st_clear | ( | st_table * | ) |
Definition at line 308 of file st.c.
References st_table::bins, st_table::entries_packed, st_table::head, st_table_entry::next, st_table::num_bins, st_table::num_entries, st_table::real_entries, st_free_entry, and st_table::tail.
Definition at line 663 of file st.c.
References st_table_entry::back, st_table::bins, st_table::entries_packed, st_table_entry::fore, st_table_entry::hash, st_table::head, MEMCPY, st_table_entry::next, st_table::num_bins, st_alloc_bins, st_alloc_entry, st_alloc_table, st_dealloc_table, st_free_table(), and st_table::tail.
Definition at line 1034 of file st.c.
References arg, st_table::bins, st_table::entries_packed, FIND_ENTRY, st_table_entry::fore, st_table_entry::hash, hash(), st_table::head, st_table_entry::key, key, last, st_table_entry::next, st_table::num_bins, PHASH, PKEY, PVAL, st_table::real_entries, st_table_entry::record, remove_entry(), remove_packed_entry(), ST_CHECK, ST_CONTINUE, st_data_t, ST_DELETE, st_free_entry, ST_STOP, and val.
Definition at line 942 of file st.c.
References arg, st_table::bins, st_table::entries_packed, FIND_ENTRY, find_packed_index(), find_packed_index_from(), st_table_entry::fore, st_table_entry::hash, hash(), st_table::head, st_table_entry::key, key, last, st_table_entry::next, st_table::num_bins, PHASH, PKEY, PVAL, st_table::real_entries, st_table_entry::record, remove_entry(), remove_safe_packed_entry(), ST_CHECK, ST_CONTINUE, st_data_t, ST_DELETE, ST_STOP, and val.
Definition at line 189 of file hash.c.
References foreach_safe_arg::arg, foreach_safe_i(), func, foreach_safe_arg::func, rb_eRuntimeError, rb_raise(), st_data_t, st_foreach_check(), and foreach_safe_arg::tbl.
| void st_free_table | ( | st_table * | ) |
Definition at line 334 of file st.c.
References st_table::bins, st_table::num_bins, st_clear(), st_dealloc_table, and st_free_bins.
| st_index_t st_hash | ( | const void * | ptr, |
| size_t | len, | ||
| st_index_t | h | ||
| ) |
Definition at line 1429 of file st.c.
References CHAR_BIT, murmur_finish(), murmur_step, MurmurMagic, SIZEOF_ST_INDEX_T, st_data_t, and UNALIGNED_ADD_ALL.
| st_index_t st_hash_end | ( | st_index_t | h | ) |
Definition at line 1593 of file st.c.
References murmur_step.
| st_index_t st_hash_start | ( | st_index_t | h | ) |
Definition at line 1602 of file st.c.
References st_hash_start.
| st_index_t st_hash_uint | ( | st_index_t | h, |
| st_index_t | i | ||
| ) |
| st_index_t st_hash_uint32 | ( | st_index_t | h, |
| uint32_t | i | ||
| ) |
Definition at line 1556 of file st.c.
References murmur_step.
| st_table* st_init_numtable | ( | void | ) |
Definition at line 272 of file st.c.
References st_init_table(), and type_numhash.
| st_table* st_init_numtable_with_size | ( | st_index_t | ) |
Definition at line 278 of file st.c.
References st_init_table_with_size(), and type_numhash.
| st_table* st_init_strcasetable | ( | void | ) |
Definition at line 296 of file st.c.
References st_init_table().
| st_table* st_init_strcasetable_with_size | ( | st_index_t | ) |
Definition at line 302 of file st.c.
References st_init_table_with_size().
| st_table* st_init_strtable | ( | void | ) |
Definition at line 284 of file st.c.
References st_init_table().
| st_table* st_init_strtable_with_size | ( | st_index_t | ) |
Definition at line 290 of file st.c.
References st_init_table_with_size().
| st_table* st_init_table | ( | const struct st_hash_type * | ) |
Definition at line 266 of file st.c.
References st_init_table_with_size().
| st_table* st_init_table_with_size | ( | const struct st_hash_type * | , |
| st_index_t | |||
| ) |
Definition at line 229 of file st.c.
References st_table::bins, st_table::entries_packed, getenv, st_table::head, MAX_PACKED_HASH, new_size(), st_table::num_bins, st_table::num_entries, size, st_alloc_bins, st_alloc_table, ST_DEFAULT_PACKED_TABLE_SIZE, st_table::tail, st_table::type, and type.
| st_index_t st_keys | ( | st_table * | table, |
| st_data_t * | keys, | ||
| st_index_t | size | ||
| ) |
Definition at line 1130 of file st.c.
References get_keys().
| st_index_t st_keys_check | ( | st_table * | table, |
| st_data_t * | keys, | ||
| st_index_t | size, | ||
| st_data_t | never | ||
| ) |
Definition at line 1136 of file st.c.
References get_keys().
Definition at line 342 of file st.c.
References st_table::entries_packed, st_table::num_bins, and st_table::num_entries.
| st_index_t st_numhash | ( | st_data_t | ) |
| int st_update | ( | st_table * | table, |
| st_data_t | key, | ||
| st_update_callback_func * | func, | ||
| st_data_t | arg | ||
| ) |
Definition at line 867 of file st.c.
References add_direct(), add_packed_direct(), arg, st_table::bins, do_hash, st_table::entries_packed, FIND_ENTRY, find_packed_index(), st_table_entry::fore, st_table_entry::key, key, last, st_table_entry::next, st_table::num_bins, PKEY, PVAL, PVAL_SET, real_entries, st_table_entry::record, remove_entry(), remove_packed_entry(), ST_CONTINUE, st_data_t, ST_DELETE, and st_free_entry.
| st_index_t st_values | ( | st_table * | table, |
| st_data_t * | values, | ||
| st_index_t | size | ||
| ) |
Definition at line 1171 of file st.c.
References get_values().
| st_index_t st_values_check | ( | st_table * | table, |
| st_data_t * | values, | ||
| st_index_t | size, | ||
| st_data_t | never | ||
| ) |
Definition at line 1177 of file st.c.
References get_values().
| RUBY_EXTERN char* strchr | ( | const char * | , |
| int | |||
| ) |
| RUBY_EXTERN char* strchr | ( | const char * | , |
| int | |||
| ) |
| RUBY_EXTERN char* strerror | ( | int | ) |
Definition at line 11 of file strerror.c.
| RUBY_EXTERN char* strerror | ( | int | ) |
Definition at line 11 of file strerror.c.
References msg, and sys_errlist.
| RUBY_EXTERN size_t strlcat | ( | char * | , |
| const char * | , | ||
| size_t | |||
| ) |
| RUBY_EXTERN size_t strlcat | ( | char * | , |
| const char * | , | ||
| size_t | |||
| ) |
| RUBY_EXTERN size_t strlcpy | ( | char * | , |
| const char * | , | ||
| size_t | |||
| ) |
| RUBY_EXTERN size_t strlcpy | ( | char * | , |
| const char * | , | ||
| size_t | |||
| ) |
| RUBY_EXTERN char* strrchr | ( | const char * | , |
| int | |||
| ) |
| RUBY_EXTERN char* strrchr | ( | const char * | , |
| int | |||
| ) |
| RUBY_EXTERN char* strstr | ( | const char * | , |
| const char * | |||
| ) |
| RUBY_EXTERN char* strstr | ( | const char * | , |
| const char * | |||
| ) |
| switch | ( | c | ) |
Definition at line 7738 of file parse.y.
References lex_strterm, NEW_STRTERM, pushback, str_dsym, and str_ssym.
| RUBY_EXTERN double tgamma | ( | double | ) |
| RUBY_EXTERN double tgamma | ( | double | ) |
|
static |
|
static |
|
static |
|
static |
|
static |
| warn_balanced | ( | "/" | , |
| "regexp literal" | |||
| ) |
| void void* xcalloc | ( | size_t | , |
| size_t | |||
| ) |
| void void xfree | ( | void * | ) |
| void* xmalloc | ( | size_t | ) |
| void* xmalloc2 | ( | size_t | , |
| size_t | |||
| ) |
| void void void* xrealloc | ( | void * | , |
| size_t | |||
| ) |
| void* xrealloc2 | ( | void * | , |
| size_t | , | ||
| size_t | |||
| ) |
|
static |
| mlhs_inner __pad14__ |
| primary_value [' opt_call_args rbracket { $$ = aryset($1, $3); } | primary_value '.' tIDENTIFIER { $$ = attrset($1, $3); } | primary_value tCOLON2 tIDENTIFIER { $$ = attrset($1, $3); } | primary_value '.' tCONSTANT { $$ = attrset($1, $3); } | primary_value tCOLON2 tCONSTANT { if (in_def || in_single) yyerror("dynamic constant assignment"); $$ = NEW_CDECL(0, 0, NEW_COLON2($1, $3)); } | tCOLON3 tCONSTANT { if (in_def || in_single) yyerror("dynamic constant assignment"); $$ = NEW_CDECL(0, 0, NEW_COLON3($2)); } | backref { rb_backref_error($1); $$ = NEW_BEGIN(0); } ;lhs : user_variable { $$ = assignable($1, 0); if (!$$) $$ = NEW_BEGIN(0); } | keyword_variable { $$ = assignable($1, 0); if (!$$) $$ = NEW_BEGIN(0); } | primary_value '[' opt_call_args rbracket { $$ = aryset($1, $3); } | primary_value '.' tIDENTIFIER { $$ = attrset($1, $3); } | primary_value tCOLON2 tIDENTIFIER { $$ = attrset($1, $3); } | primary_value '.' tCONSTANT { $$ = attrset($1, $3); } | primary_value tCOLON2 tCONSTANT { if (in_def || in_single) yyerror("dynamic constant assignment"); $$ = NEW_CDECL(0, 0, NEW_COLON2($1, $3)); } | tCOLON3 tCONSTANT { if (in_def || in_single) yyerror("dynamic constant assignment"); $$ = NEW_CDECL(0, 0, NEW_COLON3($2)); } | backref { rb_backref_error($1); $$ = NEW_BEGIN(0); } ;cname : tIDENTIFIER { yyerror("class/module name must be CONSTANT"); } | tCONSTANT ;cpath : tCOLON3 cname { $$ = NEW_COLON3($2); } | cname { $$ = NEW_COLON2(0, $$); } | primary_value tCOLON2 cname { $$ = NEW_COLON2($1, $3); } ;fname : tIDENTIFIER | tCONSTANT | tFID | op { lex_state = EXPR_ENDFN; $$ = $1; } | reswords { lex_state = EXPR_ENDFN; $$ = $<id>1; } ;fsym : fname | symbol ;fitem : fsym { $$ = NEW_LIT(ID2SYM($1)); } | dsym ;undef_list : fitem { $$ = NEW_UNDEF($1); } | undef_list ',' {lex_state = EXPR_FNAME;} fitem { $$ = block_append($1, NEW_UNDEF($4)); } ;op : '|' { ifndef_ripper($$ = '|'); } | '^' { ifndef_ripper($$ = '^'); } | '&' { ifndef_ripper($$ = '&'); } | tCMP { ifndef_ripper($$ = tCMP); } | tEQ { ifndef_ripper($$ = tEQ); } | tEQQ { ifndef_ripper($$ = tEQQ); } | tMATCH { ifndef_ripper($$ = tMATCH); } | tNMATCH { ifndef_ripper($$ = tNMATCH); } | '>' { ifndef_ripper($$ = '>'); } | tGEQ { ifndef_ripper($$ = tGEQ); } | '<' { ifndef_ripper($$ = '<'); } | tLEQ { ifndef_ripper($$ = tLEQ); } | tNEQ { ifndef_ripper($$ = tNEQ); } | tLSHFT { ifndef_ripper($$ = tLSHFT); } | tRSHFT { ifndef_ripper($$ = tRSHFT); } | '+' { ifndef_ripper($$ = '+'); } | '-' { ifndef_ripper($$ = '-'); } | '*' { ifndef_ripper($$ = '*'); } | tSTAR { ifndef_ripper($$ = '*'); } | '/' { ifndef_ripper($$ = '/'); } | '%' { ifndef_ripper($$ = '%'); } | tPOW { ifndef_ripper($$ = tPOW); } | tDSTAR { ifndef_ripper($$ = tDSTAR); } | '!' { ifndef_ripper($$ = '!'); } | '~' { ifndef_ripper($$ = '~'); } | tUPLUS { ifndef_ripper($$ = tUPLUS); } | tUMINUS { ifndef_ripper($$ = tUMINUS); } | tAREF { ifndef_ripper($$ = tAREF); } | tASET { ifndef_ripper($$ = tASET); } | '`' { ifndef_ripper($$ = '`'); } ;reswords : keyword__LINE__ | keyword__FILE__ | keyword__ENCODING__ | keyword_BEGIN | keyword_END | keyword_alias | keyword_and | keyword_begin | keyword_break | keyword_case | keyword_class | keyword_def | keyword_defined | keyword_do | keyword_else | keyword_elsif | keyword_end | keyword_ensure | keyword_false | keyword_for | keyword_in | keyword_module | keyword_next | keyword_nil | keyword_not | keyword_or | keyword_redo | keyword_rescue | keyword_retry | keyword_return | keyword_self | keyword_super | keyword_then | keyword_true | keyword_undef | keyword_when | keyword_yield | keyword_if | keyword_unless | keyword_while | keyword_until ;arg : lhs '=' arg { value_expr($3); $$ = node_assign($1, $3); } | lhs '=' arg modifier_rescue arg { value_expr($3); $3 = NEW_RESCUE($3, NEW_RESBODY(0,$5,0), 0); $$ = node_assign($1, $3); } | var_lhs tOP_ASGN arg { value_expr($3); $$ = new_op_assign($1, $2, $3); } | var_lhs tOP_ASGN arg modifier_rescue arg { value_expr($3); $3 = NEW_RESCUE($3, NEW_RESBODY(0,$5,0), 0); $$ = new_op_assign($1, $2, $3); } | primary_value '[' opt_call_args rbracket tOP_ASGN arg { NODE *args; value_expr($6); if (!$3) $3 = NEW_ZARRAY(); if (nd_type($3) == NODE_BLOCK_PASS) { args = NEW_ARGSCAT($3, $6); } else { args = arg_concat($3, $6); } if ($5 == tOROP) { $5 = 0; } else if ($5 == tANDOP) { $5 = 1; } $$ = NEW_OP_ASGN1($1, $5, args); fixpos($$, $1); } | primary_value '.' tIDENTIFIER tOP_ASGN arg { value_expr($5); $$ = new_attr_op_assign($1, ripper_id2sym('.'), $3, $4, $5); } | primary_value '.' tCONSTANT tOP_ASGN arg { value_expr($5); $$ = new_attr_op_assign($1, ripper_id2sym('.'), $3, $4, $5); } | primary_value tCOLON2 tIDENTIFIER tOP_ASGN arg { value_expr($5); $$ = new_attr_op_assign($1, ripper_intern("::"), $3, $4, $5); } | primary_value tCOLON2 tCONSTANT tOP_ASGN arg { $$ = NEW_COLON2($1, $3); $$ = new_const_op_assign($$, $4, $5); } | tCOLON3 tCONSTANT tOP_ASGN arg { $$ = NEW_COLON3($2); $$ = new_const_op_assign($$, $3, $4); } | backref tOP_ASGN arg { rb_backref_error($1); $$ = NEW_BEGIN(0); } | arg tDOT2 arg { value_expr($1); value_expr($3); $$ = NEW_DOT2($1, $3); if (nd_type($1) == NODE_LIT && FIXNUM_P($1->nd_lit) && nd_type($3) == NODE_LIT && FIXNUM_P($3->nd_lit)) { deferred_nodes = list_append(deferred_nodes, $$); } } | arg tDOT3 arg { value_expr($1); value_expr($3); $$ = NEW_DOT3($1, $3); if (nd_type($1) == NODE_LIT && FIXNUM_P($1->nd_lit) && nd_type($3) == NODE_LIT && FIXNUM_P($3->nd_lit)) { deferred_nodes = list_append(deferred_nodes, $$); } } | arg '+' arg { $$ = call_bin_op($1, '+', $3); } | arg '-' arg { $$ = call_bin_op($1, '-', $3); } | arg '*' arg { $$ = call_bin_op($1, '*', $3); } | arg '/' arg { $$ = call_bin_op($1, '/', $3); } | arg '%' arg { $$ = call_bin_op($1, '%', $3); } | arg tPOW arg { $$ = call_bin_op($1, tPOW, $3); } | tUMINUS_NUM simple_numeric tPOW arg { $$ = NEW_CALL(call_bin_op($2, tPOW, $4), tUMINUS, 0); } | tUPLUS arg { $$ = call_uni_op($2, tUPLUS); } | tUMINUS arg { $$ = call_uni_op($2, tUMINUS); } | arg '|' arg { $$ = call_bin_op($1, '|', $3); } | arg '^' arg { $$ = call_bin_op($1, '^', $3); } | arg '&' arg { $$ = call_bin_op($1, '&', $3); } | arg tCMP arg { $$ = call_bin_op($1, tCMP, $3); } | arg '>' arg { $$ = call_bin_op($1, '>', $3); } | arg tGEQ arg { $$ = call_bin_op($1, tGEQ, $3); } | arg '<' arg { $$ = call_bin_op($1, '<', $3); } | arg tLEQ arg { $$ = call_bin_op($1, tLEQ, $3); } | arg tEQ arg { $$ = call_bin_op($1, tEQ, $3); } | arg tEQQ arg { $$ = call_bin_op($1, tEQQ, $3); } | arg tNEQ arg { $$ = call_bin_op($1, tNEQ, $3); } | arg tMATCH arg { $$ = match_op($1, $3); if (nd_type($1) == NODE_LIT && RB_TYPE_P($1->nd_lit, T_REGEXP)) { $$ = reg_named_capture_assign($1->nd_lit, $$); } } | arg tNMATCH arg { $$ = call_bin_op($1, tNMATCH, $3); } | '!' arg { $$ = call_uni_op(cond($2), '!'); } | '~' arg { $$ = call_uni_op($2, '~'); } | arg tLSHFT arg { $$ = call_bin_op($1, tLSHFT, $3); } | arg tRSHFT arg { $$ = call_bin_op($1, tRSHFT, $3); } | arg tANDOP arg { $$ = logop(NODE_AND, $1, $3); } | arg tOROP arg { $$ = logop(NODE_OR, $1, $3); } | keyword_defined opt_nl {in_defined = 1;} arg { in_defined = 0; $$ = new_defined($4); } | arg '?' arg opt_nl ':' arg { value_expr($1); $$ = NEW_IF(cond($1), $3, $6); fixpos($$, $1); } | primary { $$ = $1; } ;arg_value : arg { value_expr($1); $$ = $1; if (!$$) $$ = NEW_NIL(); } ;aref_args : none | args trailer { $$ = $1; } | args ',' assocs trailer { $$ = arg_append($1, NEW_HASH($3)); } | assocs trailer { $$ = NEW_LIST(NEW_HASH($1)); } ;paren_args : '(' opt_call_args rparen { $$ = $2; } ;opt_paren_args : none | paren_args ;opt_call_args : none | call_args | args ',' { $$ = $1; } | args ',' assocs ',' { $$ = arg_append($1, NEW_HASH($3)); } | assocs ',' { $$ = NEW_LIST(NEW_HASH($1)); } ;call_args : command { value_expr($1); $$ = NEW_LIST($1); } | args opt_block_arg { $$ = arg_blk_pass($1, $2); } | assocs opt_block_arg { $$ = NEW_LIST(NEW_HASH($1)); $$ = arg_blk_pass($$, $2); } | args ',' assocs opt_block_arg { $$ = arg_append($1, NEW_HASH($3)); $$ = arg_blk_pass($$, $4); } | block_arg ;command_args : { $<val>$ = cmdarg_stack; CMDARG_PUSH(1); } call_args { cmdarg_stack = $<val>1; $$ = $2; } ;block_arg : tAMPER arg_value { $$ = NEW_BLOCK_PASS($2); } ;opt_block_arg : ',' block_arg { $$ = $2; } | none { $$ = 0; } ;args : arg_value { $$ = NEW_LIST($1); } | tSTAR arg_value { $$ = NEW_SPLAT($2); } | args ',' arg_value { NODE *n1; if ((n1 = splat_array($1)) != 0) { $$ = list_append(n1, $3); } else { $$ = arg_append($1, $3); } } | args ',' tSTAR arg_value { NODE *n1; if ((nd_type($4) == NODE_ARRAY) && (n1 = splat_array($1)) != 0) { $$ = list_concat(n1, $4); } else { $$ = arg_concat($1, $4); } } ;mrhs_arg : mrhs | arg_value ;mrhs : args ',' arg_value { NODE *n1; if ((n1 = splat_array($1)) != 0) { $$ = list_append(n1, $3); } else { $$ = arg_append($1, $3); } } | args ',' tSTAR arg_value { NODE *n1; if (nd_type($4) == NODE_ARRAY && (n1 = splat_array($1)) != 0) { $$ = list_concat(n1, $4); } else { $$ = arg_concat($1, $4); } } | tSTAR arg_value { $$ = NEW_SPLAT($2); } ;primary : literal | strings | xstring | regexp | words | qwords | symbols | qsymbols | var_ref | backref | tFID { $$ = NEW_FCALL($1, 0); } | k_begin { $<val>1 = cmdarg_stack; cmdarg_stack = 0; $<num>$ = ruby_sourceline; } bodystmt k_end { cmdarg_stack = $<val>1; if ($3 == NULL) { $$ = NEW_NIL(); } else { if (nd_type($3) == NODE_RESCUE || nd_type($3) == NODE_ENSURE) nd_set_line($3, $<num>2); $$ = NEW_BEGIN($3); } nd_set_line($$, $<num>2); } | tLPAREN_ARG {lex_state = EXPR_ENDARG;} rparen { $$ = 0; } | tLPAREN_ARG { $<val>1 = cmdarg_stack; cmdarg_stack = 0; } expr {lex_state = EXPR_ENDARG;} rparen { cmdarg_stack = $<val>1; $$ = $3; } | tLPAREN compstmt ')' { $$ = $2; } | primary_value tCOLON2 tCONSTANT { $$ = NEW_COLON2($1, $3); } | tCOLON3 tCONSTANT { $$ = NEW_COLON3($2); } | tLBRACK aref_args ']' { if ($2 == 0) { $$ = NEW_ZARRAY(); } else { $$ = $2; } } | tLBRACE assoc_list '}' { $$ = NEW_HASH($2); } | keyword_return { $$ = NEW_RETURN(0); } | keyword_yield '(' call_args rparen { $$ = new_yield($3); } | keyword_yield '(' rparen { $$ = NEW_YIELD(0); } | keyword_yield { $$ = NEW_YIELD(0); } | keyword_defined opt_nl '(' {in_defined = 1;} expr rparen { in_defined = 0; $$ = new_defined($5); } | keyword_not '(' expr rparen { $$ = call_uni_op(cond($3), '!'); } | keyword_not '(' rparen { $$ = call_uni_op(cond(NEW_NIL()), '!'); } | fcall brace_block { $2->nd_iter = $1; $$ = $2; } | method_call | method_call brace_block { block_dup_check($1->nd_args, $2); $2->nd_iter = $1; $$ = $2; } | tLAMBDA lambda { $$ = $2; } | k_if expr_value then compstmt if_tail k_end { $$ = NEW_IF(cond($2), $4, $5); fixpos($$, $2); } | k_unless expr_value then compstmt opt_else k_end { $$ = NEW_UNLESS(cond($2), $4, $5); fixpos($$, $2); } | k_while {COND_PUSH(1);} expr_value do {COND_POP();} compstmt k_end { $$ = NEW_WHILE(cond($3), $6, 1); fixpos($$, $3); } | k_until {COND_PUSH(1);} expr_value do {COND_POP();} compstmt k_end { $$ = NEW_UNTIL(cond($3), $6, 1); fixpos($$, $3); } | k_case expr_value opt_terms case_body k_end { $$ = NEW_CASE($2, $4); fixpos($$, $2); } | k_case opt_terms case_body k_end { $$ = NEW_CASE(0, $3); } | k_for for_var keyword_in {COND_PUSH(1);} expr_value do {COND_POP();} compstmt k_end { ID id = internal_id(); ID *tbl = ALLOC_N(ID, 2); NODE *m = NEW_ARGS_AUX(0, 0); NODE *args, *scope; if (nd_type($2) == NODE_MASGN) { NODE *one = NEW_LIST(NEW_LIT(INT2FIX(1))); NODE *zero = NEW_LIST(NEW_LIT(INT2FIX(0))); m->nd_next = block_append( NEW_IF( NEW_NODE(NODE_AND, NEW_CALL(NEW_CALL(NEW_DVAR(id), idLength, 0), idEq, one), NEW_CALL(NEW_CALL(NEW_DVAR(id), idAREF, zero), rb_intern("kind_of?"), NEW_LIST(NEW_LIT(rb_cArray))), 0), NEW_DASGN_CURR(id, NEW_CALL(NEW_DVAR(id), idAREF, zero)), 0), node_assign($2, NEW_DVAR(id))); args = new_args(m, 0, id, 0, new_args_tail(0, 0, 0)); } else { if (nd_type($2) == NODE_LASGN || nd_type($2) == NODE_DASGN || nd_type($2) == NODE_DASGN_CURR) { $2->nd_value = NEW_DVAR(id); m->nd_plen = 1; m->nd_next = $2; args = new_args(m, 0, 0, 0, new_args_tail(0, 0, 0)); } else { m->nd_next = node_assign(NEW_MASGN(NEW_LIST($2), 0), NEW_DVAR(id)); args = new_args(m, 0, id, 0, new_args_tail(0, 0, 0)); } } scope = NEW_NODE(NODE_SCOPE, tbl, $8, args); tbl[0] = 1; tbl[1] = id; $$ = NEW_FOR(0, $5, scope); fixpos($$, $2); } | k_class cpath superclass { if (in_def || in_single) yyerror("class definition in method body"); local_push(0); $<num>$ = ruby_sourceline; } bodystmt k_end { $$ = NEW_CLASS($2, $5, $3); nd_set_line($$, $<num>4); local_pop(); } | k_class tLSHFT expr { $<num>$ = in_def; in_def = 0; } term { $<num>$ = in_single; in_single = 0; local_push(0); } bodystmt k_end { $$ = NEW_SCLASS($3, $7); fixpos($$, $3); local_pop(); in_def = $<num>4; in_single = $<num>6; } | k_module cpath { if (in_def || in_single) yyerror("module definition in method body"); local_push(0); $<num>$ = ruby_sourceline; } bodystmt k_end { $$ = NEW_MODULE($2, $4); nd_set_line($$, $<num>3); local_pop(); } | k_def fname { $<id>$ = cur_mid; cur_mid = $2; in_def++; local_push(0); } f_arglist bodystmt k_end { NODE *body = remove_begin($5); reduce_nodes(&body); $$ = NEW_DEFN($2, $4, body, NOEX_PRIVATE); nd_set_line($$, $<num>1); local_pop(); in_def--; cur_mid = $<id>3; } | k_def singleton dot_or_colon {lex_state = EXPR_FNAME;} fname { in_single++; lex_state = EXPR_ENDFN; local_push(0); } f_arglist bodystmt k_end { NODE *body = remove_begin($8); reduce_nodes(&body); $$ = NEW_DEFS($2, $5, $7, body); nd_set_line($$, $<num>1); local_pop(); in_single--; } | keyword_break { $$ = NEW_BREAK(0); } | keyword_next { $$ = NEW_NEXT(0); } | keyword_redo { $$ = NEW_REDO(); } | keyword_retry { $$ = NEW_RETRY(); } ;primary_value : primary { value_expr($1); $$ = $1; if (!$$) $$ = NEW_NIL(); } ;k_begin : keyword_begin { token_info_push("begin"); } ;k_if : keyword_if { token_info_push("if"); } ;k_unless : keyword_unless { token_info_push("unless"); } ;k_while : keyword_while { token_info_push("while"); } ;k_until : keyword_until { token_info_push("until"); } ;k_case : keyword_case { token_info_push("case"); } ;k_for : keyword_for { token_info_push("for"); } ;k_class : keyword_class { token_info_push("class"); } ;k_module : keyword_module { token_info_push("module"); } ;k_def : keyword_def { token_info_push("def"); $<num>$ = ruby_sourceline; } ;k_end : keyword_end { token_info_pop("end"); } ;then : term | keyword_then | term keyword_then ;do : term | keyword_do_cond ;if_tail : opt_else | keyword_elsif expr_value then compstmt if_tail { $$ = NEW_IF(cond($2), $4, $5); fixpos($$, $2); } ;opt_else : none | keyword_else compstmt { $$ = $2; } ;for_var : lhs | mlhs ;f_marg : f_norm_arg { $$ = assignable($1, 0); } | tLPAREN f_margs rparen { $$ = $2; } ;f_marg_list : f_marg { $$ = NEW_LIST($1); } | f_marg_list ',' f_marg { $$ = list_append($1, $3); } ;f_margs : f_marg_list { $$ = NEW_MASGN($1, 0); } | f_marg_list ',' tSTAR f_norm_arg { $$ = assignable($4, 0); $$ = NEW_MASGN($1, $$); } | f_marg_list ',' tSTAR f_norm_arg ',' f_marg_list { $$ = assignable($4, 0); $$ = NEW_MASGN($1, NEW_POSTARG($$, $6)); } | f_marg_list ',' tSTAR { $$ = NEW_MASGN($1, -1); } | f_marg_list ',' tSTAR ',' f_marg_list { $$ = NEW_MASGN($1, NEW_POSTARG(-1, $5)); } | tSTAR f_norm_arg { $$ = assignable($2, 0); $$ = NEW_MASGN(0, $$); } | tSTAR f_norm_arg ',' f_marg_list { $$ = assignable($2, 0); $$ = NEW_MASGN(0, NEW_POSTARG($$, $4)); } | tSTAR { $$ = NEW_MASGN(0, -1); } | tSTAR ',' f_marg_list { $$ = NEW_MASGN(0, NEW_POSTARG(-1, $3)); } ;block_args_tail : f_block_kwarg ',' f_kwrest opt_f_block_arg { $$ = new_args_tail($1, $3, $4); } | f_block_kwarg opt_f_block_arg { $$ = new_args_tail($1, Qnone, $2); } | f_kwrest opt_f_block_arg { $$ = new_args_tail(Qnone, $1, $2); } | f_block_arg { $$ = new_args_tail(Qnone, Qnone, $1); } ;opt_block_args_tail : ',' block_args_tail { $$ = $2; } | { $$ = new_args_tail(Qnone, Qnone, Qnone); } ;block_param : f_arg ',' f_block_optarg ',' f_rest_arg opt_block_args_tail { $$ = new_args($1, $3, $5, Qnone, $6); } | f_arg ',' f_block_optarg ',' f_rest_arg ',' f_arg opt_block_args_tail { $$ = new_args($1, $3, $5, $7, $8); } | f_arg ',' f_block_optarg opt_block_args_tail { $$ = new_args($1, $3, Qnone, Qnone, $4); } | f_arg ',' f_block_optarg ',' f_arg opt_block_args_tail { $$ = new_args($1, $3, Qnone, $5, $6); } | f_arg ',' f_rest_arg opt_block_args_tail { $$ = new_args($1, Qnone, $3, Qnone, $4); } | f_arg ',' { $$ = new_args($1, Qnone, 1, Qnone, new_args_tail(Qnone, Qnone, Qnone)); } | f_arg ',' f_rest_arg ',' f_arg opt_block_args_tail { $$ = new_args($1, Qnone, $3, $5, $6); } | f_arg opt_block_args_tail { $$ = new_args($1, Qnone, Qnone, Qnone, $2); } | f_block_optarg ',' f_rest_arg opt_block_args_tail { $$ = new_args(Qnone, $1, $3, Qnone, $4); } | f_block_optarg ',' f_rest_arg ',' f_arg opt_block_args_tail { $$ = new_args(Qnone, $1, $3, $5, $6); } | f_block_optarg opt_block_args_tail { $$ = new_args(Qnone, $1, Qnone, Qnone, $2); } | f_block_optarg ',' f_arg opt_block_args_tail { $$ = new_args(Qnone, $1, Qnone, $3, $4); } | f_rest_arg opt_block_args_tail { $$ = new_args(Qnone, Qnone, $1, Qnone, $2); } | f_rest_arg ',' f_arg opt_block_args_tail { $$ = new_args(Qnone, Qnone, $1, $3, $4); } | block_args_tail { $$ = new_args(Qnone, Qnone, Qnone, Qnone, $1); } ;opt_block_param : none | block_param_def { command_start = TRUE; } ;block_param_def : '|' opt_bv_decl '|' { $$ = 0; } | tOROP { $$ = 0; } | '|' block_param opt_bv_decl '|' { $$ = $2; } ;opt_bv_decl : opt_nl { $$ = 0; } | opt_nl ';' bv_decls opt_nl { $$ = 0; } ;bv_decls : bvar | bv_decls ',' bvar ;bvar : tIDENTIFIER { new_bv(get_id($1)); } | f_bad_arg { $$ = 0; } ;lambda : { $<vars>$ = dyna_push(); } { $<num>$ = lpar_beg; lpar_beg = ++paren_nest; } f_larglist { $<num>$ = ruby_sourceline; } lambda_body { lpar_beg = $<num>2; $$ = NEW_LAMBDA($3, $5); nd_set_line($$, $<num>4); dyna_pop($<vars>1); } ;f_larglist : '(' f_args opt_bv_decl ')' { $$ = $2; } | f_args { $$ = $1; } ;lambda_body : tLAMBEG compstmt '}' { $$ = $2; } | keyword_do_LAMBDA compstmt keyword_end { $$ = $2; } ;do_block : keyword_do_block { $<vars>1 = dyna_push(); $<num>$ = ruby_sourceline; } opt_block_param compstmt keyword_end { $$ = NEW_ITER($3,$4); nd_set_line($$, $<num>2); dyna_pop($<vars>1); } ;block_call : command do_block { if (nd_type($1) == NODE_YIELD) { compile_error(PARSER_ARG "block given to yield"); } else { block_dup_check($1->nd_args, $2); } $2->nd_iter = $1; $$ = $2; fixpos($$, $1); } | block_call dot_or_colon operation2 opt_paren_args { $$ = NEW_CALL($1, $3, $4); } | block_call dot_or_colon operation2 opt_paren_args brace_block { block_dup_check($4, $5); $5->nd_iter = NEW_CALL($1, $3, $4); $$ = $5; fixpos($$, $1); } | block_call dot_or_colon operation2 command_args do_block { block_dup_check($4, $5); $5->nd_iter = NEW_CALL($1, $3, $4); $$ = $5; fixpos($$, $1); } ;method_call : fcall paren_args { $$ = $1; $$->nd_args = $2; } | primary_value '.' operation2 { $<num>$ = ruby_sourceline; } opt_paren_args { $$ = NEW_CALL($1, $3, $5); nd_set_line($$, $<num>4); } | primary_value tCOLON2 operation2 { $<num>$ = ruby_sourceline; } paren_args { $$ = NEW_CALL($1, $3, $5); nd_set_line($$, $<num>4); } | primary_value tCOLON2 operation3 { $$ = NEW_CALL($1, $3, 0); } | primary_value '.' { $<num>$ = ruby_sourceline; } paren_args { $$ = NEW_CALL($1, rb_intern("call"), $4); nd_set_line($$, $<num>3); } | primary_value tCOLON2 { $<num>$ = ruby_sourceline; } paren_args { $$ = NEW_CALL($1, rb_intern("call"), $4); nd_set_line($$, $<num>3); } | keyword_super paren_args { $$ = NEW_SUPER($2); } | keyword_super { $$ = NEW_ZSUPER(); } | primary_value '[' opt_call_args rbracket { if ($1 && nd_type($1) == NODE_SELF) $$ = NEW_FCALL(tAREF, $3); else $$ = NEW_CALL($1, tAREF, $3); fixpos($$, $1); } ;brace_block : '{' { $<vars>1 = dyna_push(); $<num>$ = ruby_sourceline; } opt_block_param compstmt '}' { $$ = NEW_ITER($3,$4); nd_set_line($$, $<num>2); dyna_pop($<vars>1); } | keyword_do { $<vars>1 = dyna_push(); $<num>$ = ruby_sourceline; } opt_block_param compstmt keyword_end { $$ = NEW_ITER($3,$4); nd_set_line($$, $<num>2); dyna_pop($<vars>1); } ;case_body : keyword_when args then compstmt cases { $$ = NEW_WHEN($2, $4, $5); } ;cases : opt_else | case_body ;opt_rescue : keyword_rescue exc_list exc_var then compstmt opt_rescue { if ($3) { $3 = node_assign($3, NEW_ERRINFO()); $5 = block_append($3, $5); } $$ = NEW_RESBODY($2, $5, $6); fixpos($$, $2?$2:$5); } | none ;exc_list : arg_value { $$ = NEW_LIST($1); } | mrhs { if (!($$ = splat_array($1))) $$ = $1; } | none ;exc_var : tASSOC lhs { $$ = $2; } | none ;opt_ensure : keyword_ensure compstmt { $$ = $2; } | none ;literal : numeric | symbol { $$ = NEW_LIT(ID2SYM($1)); } | dsym ;strings : string { NODE *node = $1; if (!node) { node = NEW_STR(STR_NEW0()); } else { node = evstr2dstr(node); } $$ = node; } ;string : tCHAR | string1 | string string1 { $$ = literal_concat($1, $2); } ;string1 : tSTRING_BEG string_contents tSTRING_END { $$ = $2; } ;xstring : tXSTRING_BEG xstring_contents tSTRING_END { NODE *node = $2; if (!node) { node = NEW_XSTR(STR_NEW0()); } else { switch (nd_type(node)) { case NODE_STR: nd_set_type(node, NODE_XSTR); break; case NODE_DSTR: nd_set_type(node, NODE_DXSTR); break; default: node = NEW_NODE(NODE_DXSTR, Qnil, 1, NEW_LIST(node)); break; } } $$ = node; } ;regexp : tREGEXP_BEG regexp_contents tREGEXP_END { int options = $3; NODE *node = $2; NODE *list, *prev; if (!node) { node = NEW_LIT(reg_compile(STR_NEW0(), options)); } else switch (nd_type(node)) { case NODE_STR: { VALUE src = node->nd_lit; nd_set_type(node, NODE_LIT); node->nd_lit = reg_compile(src, options); } break; default: node = NEW_NODE(NODE_DSTR, STR_NEW0(), 1, NEW_LIST(node)); case NODE_DSTR: if (options & RE_OPTION_ONCE) { nd_set_type(node, NODE_DREGX_ONCE); } else { nd_set_type(node, NODE_DREGX); } node->nd_cflag = options & RE_OPTION_MASK; if (!NIL_P(node->nd_lit)) reg_fragment_check(node->nd_lit, options); for (list = (prev = node)->nd_next; list; list = list->nd_next) { if (nd_type(list->nd_head) == NODE_STR) { VALUE tail = list->nd_head->nd_lit; if (reg_fragment_check(tail, options) && prev && !NIL_P(prev->nd_lit)) { VALUE lit = prev == node ? prev->nd_lit : prev->nd_head->nd_lit; if (!literal_concat0(parser, lit, tail)) { node = 0; break; } rb_str_resize(tail, 0); prev->nd_next = list->nd_next; rb_gc_force_recycle((VALUE)list->nd_head); rb_gc_force_recycle((VALUE)list); list = prev; } else { prev = list; } } else { prev = 0; } } if (!node->nd_next) { VALUE src = node->nd_lit; nd_set_type(node, NODE_LIT); node->nd_lit = reg_compile(src, options); } break; } $$ = node; } ;words : tWORDS_BEG ' ' tSTRING_END { $$ = NEW_ZARRAY(); } | tWORDS_BEG word_list tSTRING_END { $$ = $2; } ;word_list : { $$ = 0; } | word_list word ' ' { $$ = list_append($1, evstr2dstr($2)); } ;word : string_content | word string_content { $$ = literal_concat($1, $2); } ;symbols : tSYMBOLS_BEG ' ' tSTRING_END { $$ = NEW_ZARRAY(); } | tSYMBOLS_BEG symbol_list tSTRING_END { $$ = $2; } ;symbol_list : { $$ = 0; } | symbol_list word ' ' { $2 = evstr2dstr($2); nd_set_type($2, NODE_DSYM); $$ = list_append($1, $2); } ;qwords : tQWORDS_BEG ' ' tSTRING_END { $$ = NEW_ZARRAY(); } | tQWORDS_BEG qword_list tSTRING_END { $$ = $2; } ;qsymbols : tQSYMBOLS_BEG ' ' tSTRING_END { $$ = NEW_ZARRAY(); } | tQSYMBOLS_BEG qsym_list tSTRING_END { $$ = $2; } ;qword_list : { $$ = 0; } | qword_list tSTRING_CONTENT ' ' { $$ = list_append($1, $2); } ;qsym_list : { $$ = 0; } | qsym_list tSTRING_CONTENT ' ' { VALUE lit; lit = $2->nd_lit; $2->nd_lit = ID2SYM(rb_intern_str(lit)); nd_set_type($2, NODE_LIT); $$ = list_append($1, $2); } ;string_contents : { $$ = 0; } | string_contents string_content { $$ = literal_concat($1, $2); } ;xstring_contents: { $$ = 0; } | xstring_contents string_content { $$ = literal_concat($1, $2); } ;regexp_contents: { $$ = 0; } | regexp_contents string_content { NODE *head = $1, *tail = $2; if (!head) { $$ = tail; } else if (!tail) { $$ = head; } else { switch (nd_type(head)) { case NODE_STR: nd_set_type(head, NODE_DSTR); break; case NODE_DSTR: break; default: head = list_append(NEW_DSTR(Qnil), head); break; } $$ = list_append(head, tail); } } ;string_content : tSTRING_CONTENT | tSTRING_DVAR { $<node>$ = lex_strterm; lex_strterm = 0; lex_state = EXPR_BEG; } string_dvar { lex_strterm = $<node>2; $$ = NEW_EVSTR($3); } | tSTRING_DBEG { $<val>1 = cond_stack; $<val>$ = cmdarg_stack; cond_stack = 0; cmdarg_stack = 0; } { $<node>$ = lex_strterm; lex_strterm = 0; lex_state = EXPR_BEG; } { $<num>$ = brace_nest; brace_nest = 0; } compstmt tSTRING_DEND { cond_stack = $<val>1; cmdarg_stack = $<val>2; lex_strterm = $<node>3; brace_nest = $<num>4; if ($5) $5->flags &= ~NODE_FL_NEWLINE; $$ = new_evstr($5); } ;string_dvar : tGVAR { $$ = NEW_GVAR($1); } | tIVAR { $$ = NEW_IVAR($1); } | tCVAR { $$ = NEW_CVAR($1); } | backref ;symbol : tSYMBEG sym { lex_state = EXPR_END; $$ = $2; } ;sym : fname | tIVAR | tGVAR | tCVAR ;dsym : tSYMBEG xstring_contents tSTRING_END { lex_state = EXPR_END; $$ = dsym_node($2); } ;numeric : simple_numeric | tUMINUS_NUM simple_numeric %prec tLOWEST { $$ = negate_lit($2); } ;simple_numeric : tINTEGER | tFLOAT | tRATIONAL | tIMAGINARY ;user_variable : tIDENTIFIER | tIVAR | tGVAR | tCONSTANT | tCVAR ;keyword_variable: keyword_nil {ifndef_ripper($$ = keyword_nil);} | keyword_self {ifndef_ripper($$ = keyword_self);} | keyword_true {ifndef_ripper($$ = keyword_true);} | keyword_false {ifndef_ripper($$ = keyword_false);} | keyword__FILE__ {ifndef_ripper($$ = keyword__FILE__);} | keyword__LINE__ {ifndef_ripper($$ = keyword__LINE__);} | keyword__ENCODING__ {ifndef_ripper($$ = keyword__ENCODING__);} ;var_ref : user_variable { if (!($$ = gettable($1))) $$ = NEW_BEGIN(0); } | keyword_variable { if (!($$ = gettable($1))) $$ = NEW_BEGIN(0); } ;var_lhs : user_variable { $$ = assignable($1, 0); } | keyword_variable { $$ = assignable($1, 0); } ;backref : tNTH_REF | tBACK_REF ;superclass : term { $$ = 0; } | '<' { lex_state = EXPR_BEG; command_start = TRUE; } expr_value term { $$ = $3; } | error term { yyerrok; $$ = 0; } ;f_arglist : '(' f_args rparen { $$ = $2; lex_state = EXPR_BEG; command_start = TRUE; } | { $<num>$ = parser->parser_in_kwarg; parser->parser_in_kwarg = 1; } f_args term { parser->parser_in_kwarg = $<num>1; $$ = $2; lex_state = EXPR_BEG; command_start = TRUE; } ;args_tail : f_kwarg ',' f_kwrest opt_f_block_arg { $$ = new_args_tail($1, $3, $4); } | f_kwarg opt_f_block_arg { $$ = new_args_tail($1, Qnone, $2); } | f_kwrest opt_f_block_arg { $$ = new_args_tail(Qnone, $1, $2); } | f_block_arg { $$ = new_args_tail(Qnone, Qnone, $1); } ;opt_args_tail : ',' args_tail { $$ = $2; } | { $$ = new_args_tail(Qnone, Qnone, Qnone); } ;f_args : f_arg ',' f_optarg ',' f_rest_arg opt_args_tail { $$ = new_args($1, $3, $5, Qnone, $6); } | f_arg ',' f_optarg ',' f_rest_arg ',' f_arg opt_args_tail { $$ = new_args($1, $3, $5, $7, $8); } | f_arg ',' f_optarg opt_args_tail { $$ = new_args($1, $3, Qnone, Qnone, $4); } | f_arg ',' f_optarg ',' f_arg opt_args_tail { $$ = new_args($1, $3, Qnone, $5, $6); } | f_arg ',' f_rest_arg opt_args_tail { $$ = new_args($1, Qnone, $3, Qnone, $4); } | f_arg ',' f_rest_arg ',' f_arg opt_args_tail { $$ = new_args($1, Qnone, $3, $5, $6); } | f_arg opt_args_tail { $$ = new_args($1, Qnone, Qnone, Qnone, $2); } | f_optarg ',' f_rest_arg opt_args_tail { $$ = new_args(Qnone, $1, $3, Qnone, $4); } | f_optarg ',' f_rest_arg ',' f_arg opt_args_tail { $$ = new_args(Qnone, $1, $3, $5, $6); } | f_optarg opt_args_tail { $$ = new_args(Qnone, $1, Qnone, Qnone, $2); } | f_optarg ',' f_arg opt_args_tail { $$ = new_args(Qnone, $1, Qnone, $3, $4); } | f_rest_arg opt_args_tail { $$ = new_args(Qnone, Qnone, $1, Qnone, $2); } | f_rest_arg ',' f_arg opt_args_tail { $$ = new_args(Qnone, Qnone, $1, $3, $4); } | args_tail { $$ = new_args(Qnone, Qnone, Qnone, Qnone, $1); } | { $$ = new_args_tail(Qnone, Qnone, Qnone); $$ = new_args(Qnone, Qnone, Qnone, Qnone, $$); } ;f_bad_arg : tCONSTANT { yyerror("formal argument cannot be a constant"); $$ = 0; } | tIVAR { yyerror("formal argument cannot be an instance variable"); $$ = 0; } | tGVAR { yyerror("formal argument cannot be a global variable"); $$ = 0; } | tCVAR { yyerror("formal argument cannot be a class variable"); $$ = 0; } ;f_norm_arg : f_bad_arg | tIDENTIFIER { formal_argument(get_id($1)); $$ = $1; } ;f_arg_item : f_norm_arg { arg_var(get_id($1)); $$ = NEW_ARGS_AUX($1, 1); } | tLPAREN f_margs rparen { ID tid = internal_id(); arg_var(tid); if (dyna_in_block()) { $2->nd_value = NEW_DVAR(tid); } else { $2->nd_value = NEW_LVAR(tid); } $$ = NEW_ARGS_AUX(tid, 1); $$->nd_next = $2; } ;f_arg : f_arg_item | f_arg ',' f_arg_item { $$ = $1; $$->nd_plen++; $$->nd_next = block_append($$->nd_next, $3->nd_next); rb_gc_force_recycle((VALUE)$3); } ;f_label : tLABEL { arg_var(formal_argument(get_id($1))); $$ = $1; } ;f_kw : f_label arg_value { $$ = assignable($1, $2); $$ = NEW_KW_ARG(0, $$); } | f_label { $$ = assignable($1, (NODE *)-1); $$ = NEW_KW_ARG(0, $$); } ;f_block_kw : f_label primary_value { $$ = assignable($1, $2); $$ = NEW_KW_ARG(0, $$); } | f_label { $$ = assignable($1, (NODE *)-1); $$ = NEW_KW_ARG(0, $$); } ;f_block_kwarg : f_block_kw { $$ = $1; } | f_block_kwarg ',' f_block_kw { NODE *kws = $1; while (kws->nd_next) { kws = kws->nd_next; } kws->nd_next = $3; $$ = $1; } ;f_kwarg : f_kw { $$ = $1; } | f_kwarg ',' f_kw { NODE *kws = $1; while (kws->nd_next) { kws = kws->nd_next; } kws->nd_next = $3; $$ = $1; } ;kwrest_mark : tPOW | tDSTAR ;f_kwrest : kwrest_mark tIDENTIFIER { shadowing_lvar(get_id($2)); $$ = $2; } | kwrest_mark { $$ = internal_id(); } ;f_opt : f_norm_arg '=' arg_value { arg_var(get_id($1)); $$ = assignable($1, $3); $$ = NEW_OPT_ARG(0, $$); } ;f_block_opt : f_norm_arg '=' primary_value { arg_var(get_id($1)); $$ = assignable($1, $3); $$ = NEW_OPT_ARG(0, $$); } ;f_block_optarg : f_block_opt { $$ = $1; } | f_block_optarg ',' f_block_opt { NODE *opts = $1; while (opts->nd_next) { opts = opts->nd_next; } opts->nd_next = $3; $$ = $1; } ;f_optarg : f_opt { $$ = $1; } | f_optarg ',' f_opt { NODE *opts = $1; while (opts->nd_next) { opts = opts->nd_next; } opts->nd_next = $3; $$ = $1; } ;restarg_mark : '*' | tSTAR ;f_rest_arg : restarg_mark tIDENTIFIER { if (!is_local_id($2)) yyerror("rest argument must be local variable"); arg_var(shadowing_lvar(get_id($2))); $$ = $2; } | restarg_mark { $$ = internal_id(); arg_var($$); } ;blkarg_mark : '&' | tAMPER ;f_block_arg : blkarg_mark tIDENTIFIER { if (!is_local_id($2)) yyerror("block argument must be local variable"); else if (!dyna_in_block() && local_id($2)) yyerror("duplicated block argument name"); arg_var(shadowing_lvar(get_id($2))); $$ = $2; } ;opt_f_block_arg : ',' f_block_arg { $$ = $2; } | none { $$ = 0; } ;singleton : var_ref { value_expr($1); $$ = $1; if (!$$) $$ = NEW_NIL(); } | '(' {lex_state = EXPR_BEG;} expr rparen { if ($3 == 0) { yyerror("can't define singleton method for ()."); } else { switch (nd_type($3)) { case NODE_STR: case NODE_DSTR: case NODE_XSTR: case NODE_DXSTR: case NODE_DREGX: case NODE_LIT: case NODE_ARRAY: case NODE_ZARRAY: yyerror("can't define singleton method for literals"); default: value_expr($3); break; } } $$ = $3; } ;assoc_list : none | assocs trailer { $$ = $1; } ;assocs : assoc | assocs ',' assoc { $$ = list_concat($1, $3); } ;assoc : arg_value tASSOC arg_value { if (nd_type($1) == NODE_STR) { nd_set_type($1, NODE_LIT); $1->nd_lit = rb_fstring($1->nd_lit); } $$ = list_append(NEW_LIST($1), $3); } | tLABEL arg_value { $$ = list_append(NEW_LIST(NEW_LIT(ID2SYM($1))), $2); } | tDSTAR arg_value { $$ = list_append(NEW_LIST(0), $2); } ; ;operation : tIDENTIFIER | tCONSTANT | tFID ;operation2 : tIDENTIFIER | tCONSTANT | tFID | op ;operation3 : tIDENTIFIER | tFID | op ;dot_or_colon : '.' | tCOLON2 ;opt_terms : | terms ;opt_nl : | '\n' ;rparen : opt_nl ')' ;rbracket : opt_nl ']' ;trailer : | '\n' | ',' ;term : ';' {yyerrok;} | '\n' ;terms : term | terms ';' {yyerrok;} ;none : { $$ = 0; } ;%%#define yylvalstatic int parser_regx_options(struct parser_params*);static int parser_tokadd_string(struct parser_params*,int,int,int,long*,rb_encoding**);static void parser_tokaddmbc(struct parser_params *parser, int c, rb_encoding *enc);static int parser_parse_string(struct parser_params*,NODE*);static int parser_here_document(struct parser_params*,NODE*);#define nextc() #define pushback(c) #define newtok() #define tokspace(n) #define tokadd(c) #define tok_hex(numlen) #define read_escape(flags,e) #define tokadd_escape(e) #define regx_options() #define tokadd_string(f,t,p,n,e) #define parse_string(n) #define tokaddmbc(c, enc) #define here_document(n) #define heredoc_identifier() #define heredoc_restore(n) #define whole_match_p(e,l,i) #define number_literal_suffix(f) #define set_number_literal(v, t, f) #define set_integer_literal(v, f) #define set_yylval_str(x) #define set_yylval_num(x) #define set_yylval_id(x) #define set_yylval_name(x) #define set_yylval_literal(x) #define set_yylval_node(x) #define yylval_id() #define ripper_flush(p) #define SIGN_EXTEND_CHAR(c) #define parser_encoding_name() #define parser_mbclen() #define parser_precise_mbclen() #define is_identchar(p,e,enc) #define parser_is_identchar() #define parser_isascii() static inttoken_info_get_column(struct parser_params *parser, const char *token){ int column = 1; const char *p, *pend = lex_p - strlen(token); for (p = lex_pbeg; p < pend; p++) { if (*p == '\t') { column = (((column - 1) / 8) + 1) * 8; } column++; } return column;}static inttoken_info_has_nonspaces(struct parser_params *parser, const char *token){ const char *p, *pend = lex_p - strlen(token); for (p = lex_pbeg; p < pend; p++) { if (*p != ' ' && *p != '\t') { return 1; } } return 0;}static voidtoken_info_push(struct parser_params *parser, const char *token){ token_info *ptinfo; if (!parser->parser_token_info_enabled) return; ptinfo = ALLOC(token_info); ptinfo->token = token; ptinfo->linenum = ruby_sourceline; ptinfo->column = token_info_get_column(parser, token); ptinfo->nonspc = token_info_has_nonspaces(parser, token); ptinfo->next = parser->parser_token_info; parser->parser_token_info = ptinfo;}static voidtoken_info_pop(struct parser_params *parser, const char *token){ int linenum; token_info *ptinfo = parser->parser_token_info; if (!ptinfo) return; parser->parser_token_info = ptinfo->next; if (token_info_get_column(parser, token) == ptinfo->column) { goto finish; } linenum = ruby_sourceline; if (linenum == ptinfo->linenum) { goto finish; } if (token_info_has_nonspaces(parser, token) || ptinfo->nonspc) { goto finish; } if (parser->parser_token_info_enabled) { rb_compile_warn(ruby_sourcefile, linenum, "mismatched indentations at '%s' with '%s' at %d", token, ptinfo->token, ptinfo->linenum); } finish: xfree(ptinfo);}static intparser_yyerror(struct parser_params *parser, const char *msg){ const int max_line_margin = 30; const char *p, *pe; char *buf; long len; int i; compile_error(PARSER_ARG "%s", msg); p = lex_p; while (lex_pbeg <= p) { if (*p == '\n') break; p--; } p++; pe = lex_p; while (pe < lex_pend) { if (*pe == '\n') break; pe++; } len = pe - p; if (len > 4) { char *p2; const char *pre = "", *post = ""; if (len > max_line_margin * 2 + 10) { if (lex_p - p > max_line_margin) { p = rb_enc_prev_char(p, lex_p - max_line_margin, pe, rb_enc_get(lex_lastline)); pre = "..."; } if (pe - lex_p > max_line_margin) { pe = rb_enc_prev_char(lex_p, lex_p + max_line_margin, pe, rb_enc_get(lex_lastline)); post = "..."; } len = pe - p; } buf = ALLOCA_N(char, len+2); MEMCPY(buf, p, char, len); buf[len] = '\0'; rb_compile_error_with_enc(NULL, 0, (void *)current_enc, "%s%s%s", pre, buf, post); i = (int)(lex_p - p); p2 = buf; pe = buf + len; while (p2 < pe) { if (*p2 != '\t') *p2 = ' '; p2++; } buf[i] = '^'; buf[i+1] = '\0'; rb_compile_error_append("%s%s", pre, buf); } return 0;}static void parser_prepare(struct parser_params *parser);static VALUEdebug_lines(VALUE fname){ ID script_lines; CONST_ID(script_lines, "SCRIPT_LINES__"); if (rb_const_defined_at(rb_cObject, script_lines)) { VALUE hash = rb_const_get_at(rb_cObject, script_lines); if (RB_TYPE_P(hash, T_HASH)) { VALUE lines = rb_ary_new(); rb_hash_aset(hash, fname, lines); return lines; } } return 0;}static VALUEcoverage(VALUE fname, int n){ VALUE coverages = rb_get_coverages(); if (RTEST(coverages) && RBASIC(coverages)->klass == 0) { VALUE lines = rb_ary_new2(n); int i; RBASIC_CLEAR_CLASS(lines); for (i = 0; i < n; i++) RARRAY_ASET(lines, i, Qnil); RARRAY(lines)->as.heap.len = n; rb_hash_aset(coverages, fname, lines); return lines; } return 0;}static inte_option_supplied(struct parser_params *parser){ return strcmp(ruby_sourcefile, "-e") == 0;}static VALUEyycompile0(VALUE arg){ int n; NODE *tree; struct parser_params *parser = (struct parser_params *)arg; if (!compile_for_eval && rb_safe_level() == 0) { ruby_debug_lines = debug_lines(ruby_sourcefile_string); if (ruby_debug_lines && ruby_sourceline > 0) { VALUE str = STR_NEW0(); n = ruby_sourceline; do { rb_ary_push(ruby_debug_lines, str); } while (--n); } if (!e_option_supplied(parser)) { ruby_coverage = coverage(ruby_sourcefile_string, ruby_sourceline); } } parser->last_cr_line = ruby_sourceline - 1; parser_prepare(parser); deferred_nodes = 0; parser->parser_token_info_enabled = !compile_for_eval && RTEST(ruby_verbose); if (RUBY_DTRACE_PARSE_BEGIN_ENABLED()) { RUBY_DTRACE_PARSE_BEGIN(parser->parser_ruby_sourcefile, parser->parser_ruby_sourceline); } n = yyparse((void*)parser); if (RUBY_DTRACE_PARSE_END_ENABLED()) { RUBY_DTRACE_PARSE_END(parser->parser_ruby_sourcefile, parser->parser_ruby_sourceline); } ruby_debug_lines = 0; ruby_coverage = 0; compile_for_eval = 0; lex_strterm = 0; lex_p = lex_pbeg = lex_pend = 0; lex_lastline = lex_nextline = 0; if (parser->nerr) { return 0; } tree = ruby_eval_tree; if (!tree) { tree = NEW_NIL(); } else if (ruby_eval_tree_begin) { tree->nd_body = NEW_PRELUDE(ruby_eval_tree_begin, tree->nd_body); } return (VALUE)tree;}static NODE*yycompile(struct parser_params *parser, VALUE fname, int line){ ruby_sourcefile_string = rb_str_new_frozen(fname); ruby_sourcefile = RSTRING_PTR(fname); ruby_sourceline = line - 1; return (NODE *)rb_suppress_tracing(yycompile0, (VALUE)parser);}static rb_encoding *must_be_ascii_compatible(VALUE s){ rb_encoding *enc = rb_enc_get(s); if (!rb_enc_asciicompat(enc)) { rb_raise(rb_eArgError, "invalid source encoding"); } return enc;}static VALUElex_get_str(struct parser_params *parser, VALUE s){ char *beg, *end, *pend; rb_encoding *enc = must_be_ascii_compatible(s); beg = RSTRING_PTR(s); if (lex_gets_ptr) { if (RSTRING_LEN(s) == lex_gets_ptr) return Qnil; beg += lex_gets_ptr; } pend = RSTRING_PTR(s) + RSTRING_LEN(s); end = beg; while (end < pend) { if (*end++ == '\n') break; } lex_gets_ptr = end - RSTRING_PTR(s); return rb_enc_str_new(beg, end - beg, enc);}static VALUElex_getline(struct parser_params *parser){ VALUE line = (*parser->parser_lex_gets)(parser, parser->parser_lex_input); if (NIL_P(line)) return line; must_be_ascii_compatible(line); if (ruby_debug_lines) { rb_enc_associate(line, current_enc); rb_ary_push(ruby_debug_lines, line); } if (ruby_coverage) { rb_ary_push(ruby_coverage, Qnil); } return line;}static const rb_data_type_t parser_data_type;static NODE*parser_compile_string(volatile VALUE vparser, VALUE fname, VALUE s, int line){ struct parser_params *parser; NODE *node; TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, parser); lex_gets = lex_get_str; lex_gets_ptr = 0; lex_input = s; lex_pbeg = lex_p = lex_pend = 0; compile_for_eval = rb_parse_in_eval(); node = yycompile(parser, fname, line); RB_GC_GUARD(vparser); return node;}NODE*rb_compile_string(const char *f, VALUE s, int line){ must_be_ascii_compatible(s); return parser_compile_string(rb_parser_new(), rb_filesystem_str_new_cstr(f), s, line);}NODE*rb_parser_compile_string(volatile VALUE vparser, const char *f, VALUE s, int line){ return rb_parser_compile_string_path(vparser, rb_filesystem_str_new_cstr(f), s, line);}NODE*rb_parser_compile_string_path(volatile VALUE vparser, VALUE f, VALUE s, int line){ must_be_ascii_compatible(s); return parser_compile_string(vparser, f, s, line);}NODE*rb_compile_cstr(const char *f, const char *s, int len, int line){ VALUE str = rb_str_new(s, len); return parser_compile_string(rb_parser_new(), rb_filesystem_str_new_cstr(f), str, line);}NODE*rb_parser_compile_cstr(volatile VALUE vparser, const char *f, const char *s, int len, int line){ VALUE str = rb_str_new(s, len); return parser_compile_string(vparser, rb_filesystem_str_new_cstr(f), str, line);}static VALUElex_io_gets(struct parser_params *parser, VALUE io){ return rb_io_gets(io);}NODE*rb_compile_file(const char *f, VALUE file, int start){ VALUE volatile vparser = rb_parser_new(); return rb_parser_compile_file(vparser, f, file, start);}NODE*rb_parser_compile_file(volatile VALUE vparser, const char *f, VALUE file, int start){ return rb_parser_compile_file_path(vparser, rb_filesystem_str_new_cstr(f), file, start);}NODE*rb_parser_compile_file_path(volatile VALUE vparser, VALUE fname, VALUE file, int start){ struct parser_params *parser; NODE *node; TypedData_Get_Struct(vparser, struct parser_params, &parser_data_type, parser); lex_gets = lex_io_gets; lex_input = file; lex_pbeg = lex_p = lex_pend = 0; compile_for_eval = rb_parse_in_eval(); node = yycompile(parser, fname, start); RB_GC_GUARD(vparser); return node;}#define STR_FUNC_ESCAPE#define STR_FUNC_EXPAND#define STR_FUNC_REGEXP#define STR_FUNC_QWORDS#define STR_FUNC_SYMBOL#define STR_FUNC_INDENTenum string_type { str_squote = (0), str_dquote = (STR_FUNC_EXPAND), str_xquote = (STR_FUNC_EXPAND), str_regexp = (STR_FUNC_REGEXP|STR_FUNC_ESCAPE|STR_FUNC_EXPAND), str_sword = (STR_FUNC_QWORDS), str_dword = (STR_FUNC_QWORDS|STR_FUNC_EXPAND), str_ssym = (STR_FUNC_SYMBOL), str_dsym = (STR_FUNC_SYMBOL|STR_FUNC_EXPAND)};static VALUEparser_str_new(const char *p, long n, rb_encoding *enc, int func, rb_encoding *enc0){ VALUE str; str = rb_enc_str_new(p, n, enc); if (!(func & STR_FUNC_REGEXP) && rb_enc_asciicompat(enc)) { if (rb_enc_str_coderange(str) == ENC_CODERANGE_7BIT) { } else if (enc0 == rb_usascii_encoding() && enc != rb_utf8_encoding()) { rb_enc_associate(str, rb_ascii8bit_encoding()); } } return str;}#define lex_goto_eol(parser) #define lex_eol_p() #define peek(c) #define peek_n(c,n) static inline intparser_nextc(struct parser_params *parser){ int c; if (lex_p == lex_pend) { VALUE v = lex_nextline; lex_nextline = 0; if (!v) { if (parser->eofp) return -1; if (!lex_input || NIL_P(v = lex_getline(parser))) { parser->eofp = Qtrue; lex_goto_eol(parser); return -1; } } { if (heredoc_end > 0) { ruby_sourceline = heredoc_end; heredoc_end = 0; } ruby_sourceline++; parser->line_count++; lex_pbeg = lex_p = RSTRING_PTR(v); lex_pend = lex_p + RSTRING_LEN(v); ripper_flush(parser); lex_lastline = v; } } c = (unsigned char)*lex_p++; if (c == '\r') { if (peek('\n')) { lex_p++; c = '\n'; } else if (ruby_sourceline > parser->last_cr_line) { parser->last_cr_line = ruby_sourceline; rb_compile_warn(ruby_sourcefile, ruby_sourceline, "encountered \\r in middle of line, treated as a mere space"); } } return c;}static voidparser_pushback(struct parser_params *parser, int c){ if (c == -1) return; lex_p--; if (lex_p > lex_pbeg && lex_p[0] == '\n' && lex_p[-1] == '\r') { lex_p--; }}#define was_bol() #define tokfix() #define tok() #define toklen() #define toklast() static char*parser_newtok(struct parser_params *parser){ tokidx = 0; tokline = ruby_sourceline; if (!tokenbuf) { toksiz = 60; tokenbuf = ALLOC_N(char, 60); } if (toksiz > 4096) { toksiz = 60; REALLOC_N(tokenbuf, char, 60); } return tokenbuf;}static char *parser_tokspace(struct parser_params *parser, int n){ tokidx += n; if (tokidx >= toksiz) { do {toksiz *= 2;} while (toksiz < tokidx); REALLOC_N(tokenbuf, char, toksiz); } return &tokenbuf[tokidx-n];}static voidparser_tokadd(struct parser_params *parser, int c){ tokenbuf[tokidx++] = (char)c; if (tokidx >= toksiz) { toksiz *= 2; REALLOC_N(tokenbuf, char, toksiz); }}static intparser_tok_hex(struct parser_params *parser, size_t *numlen){ int c; c = scan_hex(lex_p, 2, numlen); if (!*numlen) { yyerror("invalid hex escape"); return 0; } lex_p += *numlen; return c;}#define tokcopy(n) static intparser_tokadd_utf8(struct parser_params *parser, rb_encoding **encp, int string_literal, int symbol_literal, int regexp_literal){ int codepoint; size_t numlen; if (regexp_literal) { tokadd('\\'); tokadd('u'); } if (peek('{')) { do { if (regexp_literal) { tokadd(*lex_p); } nextc(); codepoint = scan_hex(lex_p, 6, &numlen); if (numlen == 0) { yyerror("invalid Unicode escape"); return 0; } if (codepoint > 0x10ffff) { yyerror("invalid Unicode codepoint (too large)"); return 0; } lex_p += numlen; if (regexp_literal) { tokcopy((int)numlen); } else if (codepoint >= 0x80) { *encp = rb_utf8_encoding(); if (string_literal) tokaddmbc(codepoint, *encp); } else if (string_literal) { tokadd(codepoint); } } while (string_literal && (peek(' ') || peek('\t'))); if (!peek('}')) { yyerror("unterminated Unicode escape"); return 0; } if (regexp_literal) { tokadd('}'); } nextc(); } else { codepoint = scan_hex(lex_p, 4, &numlen); if (numlen < 4) { yyerror("invalid Unicode escape"); return 0; } lex_p += 4; if (regexp_literal) { tokcopy(4); } else if (codepoint >= 0x80) { *encp = rb_utf8_encoding(); if (string_literal) tokaddmbc(codepoint, *encp); } else if (string_literal) { tokadd(codepoint); } } return codepoint;}#define ESCAPE_CONTROL#define ESCAPE_METAstatic intparser_read_escape(struct parser_params *parser, int flags, rb_encoding **encp){ int c; size_t numlen; switch (c = nextc()) { case '\\': return c; case 'n': return '\n'; case 't': return '\t'; case 'r': return '\r'; case 'f': return '\f'; case 'v': return '\13'; case 'a': return '\007'; case 'e': return 033; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': pushback(c); c = scan_oct(lex_p, 3, &numlen); lex_p += numlen; return c; case 'x': c = tok_hex(&numlen); if (numlen == 0) return 0; return c; case 'b': return '\010'; case 's': return ' '; case 'M': if (flags & ESCAPE_META) goto eof; if ((c = nextc()) != '-') { pushback(c); goto eof; } if ((c = nextc()) == '\\') { if (peek('u')) goto eof; return read_escape(flags|ESCAPE_META, encp) | 0x80; } else if (c == -1 || !ISASCII(c)) goto eof; else { return ((c & 0xff) | 0x80); } case 'C': if ((c = nextc()) != '-') { pushback(c); goto eof; } case 'c': if (flags & ESCAPE_CONTROL) goto eof; if ((c = nextc())== '\\') { if (peek('u')) goto eof; c = read_escape(flags|ESCAPE_CONTROL, encp); } else if (c == '?') return 0177; else if (c == -1 || !ISASCII(c)) goto eof; return c & 0x9f; eof: case -1: yyerror("Invalid escape character syntax"); return '\0'; default: return c; }}static voidparser_tokaddmbc(struct parser_params *parser, int c, rb_encoding *enc){ int len = rb_enc_codelen(c, enc); rb_enc_mbcput(c, tokspace(len), enc);}static intparser_tokadd_escape(struct parser_params *parser, rb_encoding **encp){ int c; int flags = 0; size_t numlen; first: switch (c = nextc()) { case '\n': return 0; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': { ruby_scan_oct(--lex_p, 3, &numlen); if (numlen == 0) goto eof; lex_p += numlen; tokcopy((int)numlen + 1); } return 0; case 'x': { tok_hex(&numlen); if (numlen == 0) return -1; tokcopy((int)numlen + 2); } return 0; case 'M': if (flags & ESCAPE_META) goto eof; if ((c = nextc()) != '-') { pushback(c); goto eof; } tokcopy(3); flags |= ESCAPE_META; goto escaped; case 'C': if (flags & ESCAPE_CONTROL) goto eof; if ((c = nextc()) != '-') { pushback(c); goto eof; } tokcopy(3); goto escaped; case 'c': if (flags & ESCAPE_CONTROL) goto eof; tokcopy(2); flags |= ESCAPE_CONTROL; escaped: if ((c = nextc()) == '\\') { goto first; } else if (c == -1) goto eof; tokadd(c); return 0; eof: case -1: yyerror("Invalid escape character syntax"); return -1; default: tokadd('\\'); tokadd(c); } return 0;}static intparser_regx_options(struct parser_params *parser){ int kcode = 0; int kopt = 0; int options = 0; int c, opt, kc; newtok(); while (c = nextc(), ISALPHA(c)) { if (c == 'o') { options |= RE_OPTION_ONCE; } else if (rb_char_to_option_kcode(c, &opt, &kc)) { if (kc >= 0) { if (kc != rb_ascii8bit_encindex()) kcode = c; kopt = opt; } else { options |= opt; } } else { tokadd(c); } } options |= kopt; pushback(c); if (toklen()) { tokfix(); compile_error(PARSER_ARG "unknown regexp option%s - %s", toklen() > 1 ? "s" : "", tok()); } return options | RE_OPTION_ENCODING(kcode);}static voiddispose_string(VALUE str){ rb_str_free(str); rb_gc_force_recycle(str);}static intparser_tokadd_mbchar(struct parser_params *parser, int c){ int len = parser_precise_mbclen(); if (!MBCLEN_CHARFOUND_P(len)) { compile_error(PARSER_ARG "invalid multibyte char (%s)", parser_encoding_name()); return -1; } tokadd(c); lex_p += --len; if (len > 0) tokcopy(len); return c;}#define tokadd_mbchar(c) static inline intsimple_re_meta(int c){ switch (c) { case '$': case '*': case '+': case '.': case '?': case '^': case '|': case ')': case ']': case '}': case '>': return TRUE; default: return FALSE; }}static intparser_tokadd_string(struct parser_params *parser, int func, int term, int paren, long *nest, rb_encoding **encp){ int c; int has_nonascii = 0; rb_encoding *enc = *encp; char *errbuf = 0; static const char mixed_msg[] = "%s mixed within %s source";#define mixed_error(enc1, enc2) #define mixed_escape(beg, enc1, enc2) while ((c = nextc()) != -1) { if (paren && c == paren) { ++*nest; } else if (c == term) { if (!nest || !*nest) { pushback(c); break; } --*nest; } else if ((func & STR_FUNC_EXPAND) && c == '#' && lex_p < lex_pend) { int c2 = *lex_p; if (c2 == '$' || c2 == '@' || c2 == '{') { pushback(c); break; } } else if (c == '\\') { const char *beg = lex_p - 1; c = nextc(); switch (c) { case '\n': if (func & STR_FUNC_QWORDS) break; if (func & STR_FUNC_EXPAND) continue; tokadd('\\'); break; case '\\': if (func & STR_FUNC_ESCAPE) tokadd(c); break; case 'u': if ((func & STR_FUNC_EXPAND) == 0) { tokadd('\\'); break; } parser_tokadd_utf8(parser, &enc, 1, func & STR_FUNC_SYMBOL, func & STR_FUNC_REGEXP); if (has_nonascii && enc != *encp) { mixed_escape(beg, enc, *encp); } continue; default: if (c == -1) return -1; if (!ISASCII(c)) { if ((func & STR_FUNC_EXPAND) == 0) tokadd('\\'); goto non_ascii; } if (func & STR_FUNC_REGEXP) { if (c == term && !simple_re_meta(c)) { tokadd(c); continue; } pushback(c); if ((c = tokadd_escape(&enc)) < 0) return -1; if (has_nonascii && enc != *encp) { mixed_escape(beg, enc, *encp); } continue; } else if (func & STR_FUNC_EXPAND) { pushback(c); if (func & STR_FUNC_ESCAPE) tokadd('\\'); c = read_escape(0, &enc); } else if ((func & STR_FUNC_QWORDS) && ISSPACE(c)) { } else if (c != term && !(paren && c == paren)) { tokadd('\\'); pushback(c); continue; } } } else if (!parser_isascii()) { non_ascii: has_nonascii = 1; if (enc != *encp) { mixed_error(enc, *encp); continue; } if (tokadd_mbchar(c) == -1) return -1; continue; } else if ((func & STR_FUNC_QWORDS) && ISSPACE(c)) { pushback(c); break; } if (c & 0x80) { has_nonascii = 1; if (enc != *encp) { mixed_error(enc, *encp); continue; } } tokadd(c); } *encp = enc; return c;}#define NEW_STRTERM(func, term, paren) #define flush_string_content(enc) RUBY_FUNC_EXPORTED const unsigned int ruby_global_name_punct_bits[(0x7e - 0x20 + 31) / 32];#define BIT(c, idx) #define SPECIAL_PUNCT(idx) const unsigned int ruby_global_name_punct_bits[] = { SPECIAL_PUNCT(0), SPECIAL_PUNCT(1), SPECIAL_PUNCT(2),};static inline intis_global_name_punct(const int c){ if (c <= 0x20 || 0x7e < c) return 0; return (ruby_global_name_punct_bits[(c - 0x20) / 32] >> (c % 32)) & 1;}static intparser_peek_variable_name(struct parser_params *parser){ int c; const char *p = lex_p; if (p + 1 >= lex_pend) return 0; c = *p++; switch (c) { case '$': if ((c = *p) == '-') { if (++p >= lex_pend) return 0; c = *p; } else if (is_global_name_punct(c) || ISDIGIT(c)) { return tSTRING_DVAR; } break; case '@': if ((c = *p) == '@') { if (++p >= lex_pend) return 0; c = *p; } break; case '{': lex_p = p; command_start = TRUE; return tSTRING_DBEG; default: return 0; } if (!ISASCII(c) || c == '_' || ISALPHA(c)) return tSTRING_DVAR; return 0;}static intparser_parse_string(struct parser_params *parser, NODE *quote){ int func = (int)quote->nd_func; int term = nd_term(quote); int paren = nd_paren(quote); int c, space = 0; rb_encoding *enc = current_enc; if (func == -1) return tSTRING_END; c = nextc(); if ((func & STR_FUNC_QWORDS) && ISSPACE(c)) { do {c = nextc();} while (ISSPACE(c)); space = 1; } if (c == term && !quote->nd_nest) { if (func & STR_FUNC_QWORDS) { quote->nd_func = -1; return ' '; } if (!(func & STR_FUNC_REGEXP)) return tSTRING_END; set_yylval_num(regx_options()); return tREGEXP_END; } if (space) { pushback(c); return ' '; } newtok(); if ((func & STR_FUNC_EXPAND) && c == '#') { int t = parser_peek_variable_name(parser); if (t) return t; tokadd('#'); c = nextc(); } pushback(c); if (tokadd_string(func, term, paren, "e->nd_nest, &enc) == -1) { ruby_sourceline = nd_line(quote); if (func & STR_FUNC_REGEXP) { if (parser->eofp) compile_error(PARSER_ARG "unterminated regexp meets end of file"); return tREGEXP_END; } else { if (parser->eofp) compile_error(PARSER_ARG "unterminated string meets end of file"); return tSTRING_END; } } tokfix(); set_yylval_str(STR_NEW3(tok(), toklen(), enc, func)); flush_string_content(enc); return tSTRING_CONTENT;}static intparser_heredoc_identifier(struct parser_params *parser){ int c = nextc(), term, func = 0; long len; if (c == '-') { c = nextc(); func = STR_FUNC_INDENT; } switch (c) { case '\'': func |= str_squote; goto quoted; case '"': func |= str_dquote; goto quoted; case '`': func |= str_xquote; quoted: newtok(); tokadd(func); term = c; while ((c = nextc()) != -1 && c != term) { if (tokadd_mbchar(c) == -1) return 0; } if (c == -1) { compile_error(PARSER_ARG "unterminated here document identifier"); return 0; } break; default: if (!parser_is_identchar()) { pushback(c); if (func & STR_FUNC_INDENT) { pushback('-'); } return 0; } newtok(); term = '"'; tokadd(func |= str_dquote); do { if (tokadd_mbchar(c) == -1) return 0; } while ((c = nextc()) != -1 && parser_is_identchar()); pushback(c); break; } tokfix(); len = lex_p - lex_pbeg; lex_goto_eol(parser); lex_strterm = rb_node_newnode(NODE_HEREDOC, STR_NEW(tok(), toklen()), len, lex_lastline); nd_set_line(lex_strterm, ruby_sourceline); ripper_flush(parser); return term == '`' ? tXSTRING_BEG : tSTRING_BEG;}static voidparser_heredoc_restore(struct parser_params *parser, NODE *here){ VALUE line; lex_strterm = 0; line = here->nd_orig; lex_lastline = line; lex_pbeg = RSTRING_PTR(line); lex_pend = lex_pbeg + RSTRING_LEN(line); lex_p = lex_pbeg + here->nd_nth; heredoc_end = ruby_sourceline; ruby_sourceline = nd_line(here); dispose_string(here->nd_lit); rb_gc_force_recycle((VALUE)here); ripper_flush(parser);}static intparser_whole_match_p(struct parser_params *parser, const char *eos, long len, int indent){ const char *p = lex_pbeg; long n; if (indent) { while (*p && ISSPACE(*p)) p++; } n = lex_pend - (p + len); if (n < 0) return FALSE; if (n > 0 && p[len] != '\n') { if (p[len] != '\r') return FALSE; if (n <= 1 || p[len+1] != '\n') return FALSE; } return strncmp(eos, p, len) == 0;}#define NUM_SUFFIX_R#define NUM_SUFFIX_I#define NUM_SUFFIX_ALLstatic intparser_number_literal_suffix(struct parser_params *parser, int mask){ int c, result = 0; const char *lastp = lex_p; while ((c = nextc()) != -1) { if ((mask & NUM_SUFFIX_I) && c == 'i') { result |= (mask & NUM_SUFFIX_I); mask &= ~NUM_SUFFIX_I; mask &= ~NUM_SUFFIX_R; continue; } if ((mask & NUM_SUFFIX_R) && c == 'r') { result |= (mask & NUM_SUFFIX_R); mask &= ~NUM_SUFFIX_R; continue; } if (!ISASCII(c) || ISALPHA(c) || c == '_') { lex_p = lastp; return 0; } pushback(c); break; } return result;}static intparser_set_number_literal(struct parser_params *parser, VALUE v, int type, int suffix){ if (suffix & NUM_SUFFIX_I) { v = rb_complex_raw(INT2FIX(0), v); type = tIMAGINARY; } set_yylval_literal(v); return type;}static intparser_set_integer_literal(struct parser_params *parser, VALUE v, int suffix){ int type = tINTEGER; if (suffix & NUM_SUFFIX_R) { v = rb_rational_raw1(v); type = tRATIONAL; } return set_number_literal(v, type, suffix);}#define dispatch_heredoc_end() static intparser_here_document(struct parser_params *parser, NODE *here){ int c, func, indent = 0; const char *eos, *p, *pend; long len; VALUE str = 0; rb_encoding *enc = current_enc; eos = RSTRING_PTR(here->nd_lit); len = RSTRING_LEN(here->nd_lit) - 1; indent = (func = *eos++) & STR_FUNC_INDENT; if ((c = nextc()) == -1) { error: compile_error(PARSER_ARG "can't find string \"%s\" anywhere before EOF", eos); restore: heredoc_restore(lex_strterm); return 0; } if (was_bol() && whole_match_p(eos, len, indent)) { dispatch_heredoc_end(); heredoc_restore(lex_strterm); return tSTRING_END; } if (!(func & STR_FUNC_EXPAND)) { do { p = RSTRING_PTR(lex_lastline); pend = lex_pend; if (pend > p) { switch (pend[-1]) { case '\n': if (--pend == p || pend[-1] != '\r') { pend++; break; } case '\r': --pend; } } if (str) rb_str_cat(str, p, pend - p); else str = STR_NEW(p, pend - p); if (pend < lex_pend) rb_str_cat(str, "\n", 1); lex_goto_eol(parser); if (nextc() == -1) { if (str) dispose_string(str); goto error; } } while (!whole_match_p(eos, len, indent)); } else { newtok(); if (c == '#') { int t = parser_peek_variable_name(parser); if (t) return t; tokadd('#'); c = nextc(); } do { pushback(c); if ((c = tokadd_string(func, '\n', 0, NULL, &enc)) == -1) { if (parser->eofp) goto error; goto restore; } if (c != '\n') { set_yylval_str(STR_NEW3(tok(), toklen(), enc, func)); flush_string_content(enc); return tSTRING_CONTENT; } tokadd(nextc()); if ((c = nextc()) == -1) goto error; } while (!whole_match_p(eos, len, indent)); str = STR_NEW3(tok(), toklen(), enc, func); } dispatch_heredoc_end(); heredoc_restore(lex_strterm); lex_strterm = NEW_STRTERM(-1, 0, 0); set_yylval_str(str); return tSTRING_CONTENT;}static voidarg_ambiguous_gen(struct parser_params *parser){ rb_warning0("ambiguous first argument; put parentheses or even spaces");}#define arg_ambiguous() static IDformal_argument_gen(struct parser_params *parser, ID lhs){ if (!is_local_id(lhs)) yyerror("formal argument must be local variable"); shadowing_lvar(lhs); return lhs;}static intlvar_defined_gen(struct parser_params *parser, ID id){ return (dyna_in_block() && dvar_defined_get(id)) || local_id(id);}static longparser_encode_length(struct parser_params *parser, const char *name, long len){ long nlen; if (len > 5 && name[nlen = len - 5] == '-') { if (rb_memcicmp(name + nlen + 1, "unix", 4) == 0) return nlen; } if (len > 4 && name[nlen = len - 4] == '-') { if (rb_memcicmp(name + nlen + 1, "dos", 3) == 0) return nlen; if (rb_memcicmp(name + nlen + 1, "mac", 3) == 0 && !(len == 8 && rb_memcicmp(name, "utf8-mac", len) == 0)) return nlen; } return len;}static voidparser_set_encode(struct parser_params *parser, const char *name){ int idx = rb_enc_find_index(name); rb_encoding *enc; VALUE excargs[3]; if (idx < 0) { excargs[1] = rb_sprintf("unknown encoding name: %s", name); error: excargs[0] = rb_eArgError; excargs[2] = rb_make_backtrace(); rb_ary_unshift(excargs[2], rb_sprintf("%s:%d", ruby_sourcefile, ruby_sourceline)); rb_exc_raise(rb_make_exception(3, excargs)); } enc = rb_enc_from_index(idx); if (!rb_enc_asciicompat(enc)) { excargs[1] = rb_sprintf("%s is not ASCII compatible", rb_enc_name(enc)); goto error; } parser->enc = enc; if (ruby_debug_lines) { VALUE lines = ruby_debug_lines; long i, n = RARRAY_LEN(lines); for (i = 0; i < n; ++i) { rb_enc_associate_index(RARRAY_AREF(lines, i), idx); } }}static intcomment_at_top(struct parser_params *parser){ const char *p = lex_pbeg, *pend = lex_p - 1; if (parser->line_count != (parser->has_shebang ? 2 : 1)) return 0; while (p < pend) { if (!ISSPACE(*p)) return 0; p++; } return 1;}typedef long (*rb_magic_comment_length_t)(struct parser_params *parser, const char *name, long len);typedef void (*rb_magic_comment_setter_t)(struct parser_params *parser, const char *name, const char *val);static voidmagic_comment_encoding(struct parser_params *parser, const char *name, const char *val){ if (!comment_at_top(parser)) { return; } parser_set_encode(parser, val);}static voidparser_set_token_info(struct parser_params *parser, const char *name, const char *val){ int *p = &parser->parser_token_info_enabled; switch (*val) { case 't': case 'T': if (strcasecmp(val, "true") == 0) { *p = TRUE; return; } break; case 'f': case 'F': if (strcasecmp(val, "false") == 0) { *p = FALSE; return; } break; } rb_compile_warning(ruby_sourcefile, ruby_sourceline, "invalid value for %s: %s", name, val);}struct magic_comment { const char *name; rb_magic_comment_setter_t func; rb_magic_comment_length_t length;};static const struct magic_comment magic_comments[] = { {"coding", magic_comment_encoding, parser_encode_length}, {"encoding", magic_comment_encoding, parser_encode_length}, {"warn_indent", parser_set_token_info},};static const char *magic_comment_marker(const char *str, long len){ long i = 2; while (i < len) { switch (str[i]) { case '-': if (str[i-1] == '*' && str[i-2] == '-') { return str + i + 1; } i += 2; break; case '*': if (i + 1 >= len) return 0; if (str[i+1] != '-') { i += 4; } else if (str[i-1] != '-') { i += 2; } else { return str + i + 2; } break; default: i += 3; break; } } return 0;}static intparser_magic_comment(struct parser_params *parser, const char *str, long len){ VALUE name = 0, val = 0; const char *beg, *end, *vbeg, *vend;#define str_copy(_s, _p, _n) if (len <= 7) return FALSE; if (!(beg = magic_comment_marker(str, len))) return FALSE; if (!(end = magic_comment_marker(beg, str + len - beg))) return FALSE; str = beg; len = end - beg - 3; while (len > 0) { const struct magic_comment *p = magic_comments; char *s; int i; long n = 0; for (; len > 0 && *str; str++, --len) { switch (*str) { case '\'': case '"': case ':': case ';': continue; } if (!ISSPACE(*str)) break; } for (beg = str; len > 0; str++, --len) { switch (*str) { case '\'': case '"': case ':': case ';': break; default: if (ISSPACE(*str)) break; continue; } break; } for (end = str; len > 0 && ISSPACE(*str); str++, --len); if (!len) break; if (*str != ':') continue; do str++; while (--len > 0 && ISSPACE(*str)); if (!len) break; if (*str == '"') { for (vbeg = ++str; --len > 0 && *str != '"'; str++) { if (*str == '\\') { --len; ++str; } } vend = str; if (len) { --len; ++str; } } else { for (vbeg = str; len > 0 && *str != '"' && *str != ';' && !ISSPACE(*str); --len, str++); vend = str; } while (len > 0 && (*str == ';' || ISSPACE(*str))) --len, str++; n = end - beg; str_copy(name, beg, n); s = RSTRING_PTR(name); for (i = 0; i < n; ++i) { if (s[i] == '-') s[i] = '_'; } do { if (STRNCASECMP(p->name, s, n) == 0) { n = vend - vbeg; if (p->length) { n = (*p->length)(parser, vbeg, n); } str_copy(val, vbeg, n); (*p->func)(parser, s, RSTRING_PTR(val)); break; } } while (++p < magic_comments + numberof(magic_comments)); } return TRUE;}static voidset_file_encoding(struct parser_params *parser, const char *str, const char *send){ int sep = 0; const char *beg = str; VALUE s; for (;;) { if (send - str <= 6) return; switch (str[6]) { case 'C': case 'c': str += 6; continue; case 'O': case 'o': str += 5; continue; case 'D': case 'd': str += 4; continue; case 'I': case 'i': str += 3; continue; case 'N': case 'n': str += 2; continue; case 'G': case 'g': str += 1; continue; case '=': case ':': sep = 1; str += 6; break; default: str += 6; if (ISSPACE(*str)) break; continue; } if (STRNCASECMP(str-6, "coding", 6) == 0) break; } for (;;) { do { if (++str >= send) return; } while (ISSPACE(*str)); if (sep) break; if (*str != '=' && *str != ':') return; sep = 1; str++; } beg = str; while ((*str == '-' || *str == '_' || ISALNUM(*str)) && ++str < send); s = rb_str_new(beg, parser_encode_length(parser, beg, str - beg)); parser_set_encode(parser, RSTRING_PTR(s)); rb_str_resize(s, 0);}static voidparser_prepare(struct parser_params *parser){ int c = nextc(); switch (c) { case '#': if (peek('!')) parser->has_shebang = 1; break; case 0xef: if (lex_pend - lex_p >= 2 && (unsigned char)lex_p[0] == 0xbb && (unsigned char)lex_p[1] == 0xbf) { parser->enc = rb_utf8_encoding(); lex_p += 2; lex_pbeg = lex_p; return; } break; case EOF: return; } pushback(c); parser->enc = rb_enc_get(lex_lastline);}#define IS_ARG() #define IS_END() #define IS_BEG() #define IS_SPCARG(c) #define IS_LABEL_POSSIBLE() #define IS_LABEL_SUFFIX(n) #define IS_AFTER_OPERATOR() #define ambiguous_operator(op, syn) #define warn_balanced(op, syn) static intparser_yylex(struct parser_params *parser){ register int c; int space_seen = 0; int cmd_state; enum lex_state_e last_state; rb_encoding *enc; int mb; if (lex_strterm) { int token; if (nd_type(lex_strterm) == NODE_HEREDOC) { token = here_document(lex_strterm); if (token == tSTRING_END) { lex_strterm = 0; lex_state = EXPR_END; } } else { token = parse_string(lex_strterm); if (token == tSTRING_END || token == tREGEXP_END) { rb_gc_force_recycle((VALUE)lex_strterm); lex_strterm = 0; lex_state = EXPR_END; } } return token; } cmd_state = command_start; command_start = FALSE; retry: last_state = lex_state; switch (c = nextc()) { case '\0': case '\004': case '\032': case -1: return 0; case ' ': case '\t': case '\f': case '\r': case '\13': space_seen = 1; goto retry; case '#': if (!parser_magic_comment(parser, lex_p, lex_pend - lex_p)) { if (comment_at_top(parser)) { set_file_encoding(parser, lex_p, lex_pend); } } lex_p = lex_pend; case '\n': if (IS_lex_state(EXPR_BEG | EXPR_VALUE | EXPR_CLASS | EXPR_FNAME | EXPR_DOT | EXPR_LABELARG)) { if (IS_lex_state(EXPR_LABELARG) && parser->parser_in_kwarg) { goto normal_newline; } goto retry; } while ((c = nextc())) { switch (c) { case ' ': case '\t': case '\f': case '\r': case '\13': space_seen = 1; break; case '.': { if ((c = nextc()) != '.') { pushback(c); pushback('.'); goto retry; } } default: --ruby_sourceline; lex_nextline = lex_lastline; case -1: lex_goto_eol(parser); goto normal_newline; } } normal_newline: command_start = TRUE; lex_state = EXPR_BEG; return '\n'; case '*': if ((c = nextc()) == '*') { if ((c = nextc()) == '=') { set_yylval_id(tPOW); lex_state = EXPR_BEG; return tOP_ASGN; } pushback(c); if (IS_SPCARG(c)) { rb_warning0("`**' interpreted as argument prefix"); c = tDSTAR; } else if (IS_BEG()) { c = tDSTAR; } else { warn_balanced("**", "argument prefix"); c = tPOW; } } else { if (c == '=') { set_yylval_id('*'); lex_state = EXPR_BEG; return tOP_ASGN; } pushback(c); if (IS_SPCARG(c)) { rb_warning0("`*' interpreted as argument prefix"); c = tSTAR; } else if (IS_BEG()) { c = tSTAR; } else { warn_balanced("*", "argument prefix"); c = '*'; } } lex_state = IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG; return c; case '!': c = nextc(); if (IS_AFTER_OPERATOR()) { lex_state = EXPR_ARG; if (c == '@') { return '!'; } } else { lex_state = EXPR_BEG; } if (c == '=') { return tNEQ; } if (c == '~') { return tNMATCH; } pushback(c); return '!'; case '=': if (was_bol()) { if (strncmp(lex_p, "begin", 5) == 0 && ISSPACE(lex_p[5])) { for (;;) { lex_goto_eol(parser); c = nextc(); if (c == -1) { compile_error(PARSER_ARG "embedded document meets end of file"); return 0; } if (c != '=') continue; if (strncmp(lex_p, "end", 3) == 0 && (lex_p + 3 == lex_pend || ISSPACE(lex_p[3]))) { break; } } lex_goto_eol(parser); goto retry; } } lex_state = IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG; if ((c = nextc()) == '=') { if ((c = nextc()) == '=') { return tEQQ; } pushback(c); return tEQ; } if (c == '~') { return tMATCH; } else if (c == '>') { return tASSOC; } pushback(c); return '='; case '<': last_state = lex_state; c = nextc(); if (c == '<' && !IS_lex_state(EXPR_DOT | EXPR_CLASS) && !IS_END() && (!IS_ARG() || space_seen)) { int token = heredoc_identifier(); if (token) return token; } if (IS_AFTER_OPERATOR()) { lex_state = EXPR_ARG; } else { if (IS_lex_state(EXPR_CLASS)) command_start = TRUE; lex_state = EXPR_BEG; } if (c == '=') { if ((c = nextc()) == '>') { return tCMP; } pushback(c); return tLEQ; } if (c == '<') { if ((c = nextc()) == '=') { set_yylval_id(tLSHFT); lex_state = EXPR_BEG; return tOP_ASGN; } pushback(c); warn_balanced("<<", "here document"); return tLSHFT; } pushback(c); return '<'; case '>': lex_state = IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG; if ((c = nextc()) == '=') { return tGEQ; } if (c == '>') { if ((c = nextc()) == '=') { set_yylval_id(tRSHFT); lex_state = EXPR_BEG; return tOP_ASGN; } pushback(c); return tRSHFT; } pushback(c); return '>'; case '"': lex_strterm = NEW_STRTERM(str_dquote, '"', 0); return tSTRING_BEG; case '`': if (IS_lex_state(EXPR_FNAME)) { lex_state = EXPR_ENDFN; return c; } if (IS_lex_state(EXPR_DOT)) { if (cmd_state) lex_state = EXPR_CMDARG; else lex_state = EXPR_ARG; return c; } lex_strterm = NEW_STRTERM(str_xquote, '`', 0); return tXSTRING_BEG; case '\'': lex_strterm = NEW_STRTERM(str_squote, '\'', 0); return tSTRING_BEG; case '?': if (IS_END()) { lex_state = EXPR_VALUE; return '?'; } c = nextc(); if (c == -1) { compile_error(PARSER_ARG "incomplete character syntax"); return 0; } if (rb_enc_isspace(c, current_enc)) { if (!IS_ARG()) { int c2 = 0; switch (c) { case ' ': c2 = 's'; break; case '\n': c2 = 'n'; break; case '\t': c2 = 't'; break; case '\v': c2 = 'v'; break; case '\r': c2 = 'r'; break; case '\f': c2 = 'f'; break; } if (c2) { rb_warnI("invalid character syntax; use ?\\%c", c2); } } ternary: pushback(c); lex_state = EXPR_VALUE; return '?'; } newtok(); enc = current_enc; if (!parser_isascii()) { if (tokadd_mbchar(c) == -1) return 0; } else if ((rb_enc_isalnum(c, current_enc) || c == '_') && lex_p < lex_pend && is_identchar(lex_p, lex_pend, current_enc)) { goto ternary; } else if (c == '\\') { if (peek('u')) { nextc(); c = parser_tokadd_utf8(parser, &enc, 0, 0, 0); if (0x80 <= c) { tokaddmbc(c, enc); } else { tokadd(c); } } else if (!lex_eol_p() && !(c = *lex_p, ISASCII(c))) { nextc(); if (tokadd_mbchar(c) == -1) return 0; } else { c = read_escape(0, &enc); tokadd(c); } } else { tokadd(c); } tokfix(); set_yylval_str(STR_NEW3(tok(), toklen(), enc, 0)); lex_state = EXPR_END; return tCHAR; case '&': if ((c = nextc()) == '&') { lex_state = EXPR_BEG; if ((c = nextc()) == '=') { set_yylval_id(tANDOP); lex_state = EXPR_BEG; return tOP_ASGN; } pushback(c); return tANDOP; } else if (c == '=') { set_yylval_id('&'); lex_state = EXPR_BEG; return tOP_ASGN; } pushback(c); if (IS_SPCARG(c)) { rb_warning0("`&' interpreted as argument prefix"); c = tAMPER; } else if (IS_BEG()) { c = tAMPER; } else { warn_balanced("&", "argument prefix"); c = '&'; } lex_state = IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG; return c; case '|': if ((c = nextc()) == '|') { lex_state = EXPR_BEG; if ((c = nextc()) == '=') { set_yylval_id(tOROP); lex_state = EXPR_BEG; return tOP_ASGN; } pushback(c); return tOROP; } if (c == '=') { set_yylval_id('|'); lex_state = EXPR_BEG; return tOP_ASGN; } lex_state = IS_AFTER_OPERATOR() ? EXPR_ARG : EXPR_BEG; pushback(c); return '|'; case '+': c = nextc(); if (IS_AFTER_OPERATOR()) { lex_state = EXPR_ARG; if (c == '@') { return tUPLUS; } pushback(c); return '+'; } if (c == '=') { set_yylval_id('+'); lex_state = EXPR_BEG; return tOP_ASGN; } if (IS_BEG() || (IS_SPCARG(c) && arg_ambiguous())) { lex_state = EXPR_BEG; pushback(c); if (c != -1 && ISDIGIT(c)) { c = '+'; goto start_num; } return tUPLUS; } lex_state = EXPR_BEG; pushback(c); warn_balanced("+", "unary operator"); return '+'; case '-': c = nextc(); if (IS_AFTER_OPERATOR()) { lex_state = EXPR_ARG; if (c == '@') { return tUMINUS; } pushback(c); return '-'; } if (c == '=') { set_yylval_id('-'); lex_state = EXPR_BEG; return tOP_ASGN; } if (c == '>') { lex_state = EXPR_ENDFN; return tLAMBDA; } if (IS_BEG() || (IS_SPCARG(c) && arg_ambiguous())) { lex_state = EXPR_BEG; pushback(c); if (c != -1 && ISDIGIT(c)) { return tUMINUS_NUM; } return tUMINUS; } lex_state = EXPR_BEG; pushback(c); warn_balanced("-", "unary operator"); return '-'; case '.': lex_state = EXPR_BEG; if ((c = nextc()) == '.') { if ((c = nextc()) == '.') { return tDOT3; } pushback(c); return tDOT2; } pushback(c); if (c != -1 && ISDIGIT(c)) { yyerror("no .<digit> floating literal anymore; put 0 before dot"); } lex_state = EXPR_DOT; return '.'; start_num: case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': { int is_float, seen_point, seen_e, nondigit; int suffix; is_float = seen_point = seen_e = nondigit = 0; lex_state = EXPR_END; newtok(); if (c == '-' || c == '+') { tokadd(c); c = nextc(); } if (c == '0') {#define no_digits() int start = toklen(); c = nextc(); if (c == 'x' || c == 'X') { c = nextc(); if (c != -1 && ISXDIGIT(c)) { do { if (c == '_') { if (nondigit) break; nondigit = c; continue; } if (!ISXDIGIT(c)) break; nondigit = 0; tokadd(c); } while ((c = nextc()) != -1); } pushback(c); tokfix(); if (toklen() == start) { no_digits(); } else if (nondigit) goto trailing_uc; suffix = number_literal_suffix(NUM_SUFFIX_ALL); return set_integer_literal(rb_cstr_to_inum(tok(), 16, FALSE), suffix); } if (c == 'b' || c == 'B') { c = nextc(); if (c == '0' || c == '1') { do { if (c == '_') { if (nondigit) break; nondigit = c; continue; } if (c != '0' && c != '1') break; nondigit = 0; tokadd(c); } while ((c = nextc()) != -1); } pushback(c); tokfix(); if (toklen() == start) { no_digits(); } else if (nondigit) goto trailing_uc; suffix = number_literal_suffix(NUM_SUFFIX_ALL); return set_integer_literal(rb_cstr_to_inum(tok(), 2, FALSE), suffix); } if (c == 'd' || c == 'D') { c = nextc(); if (c != -1 && ISDIGIT(c)) { do { if (c == '_') { if (nondigit) break; nondigit = c; continue; } if (!ISDIGIT(c)) break; nondigit = 0; tokadd(c); } while ((c = nextc()) != -1); } pushback(c); tokfix(); if (toklen() == start) { no_digits(); } else if (nondigit) goto trailing_uc; suffix = number_literal_suffix(NUM_SUFFIX_ALL); return set_integer_literal(rb_cstr_to_inum(tok(), 10, FALSE), suffix); } if (c == '_') { goto octal_number; } if (c == 'o' || c == 'O') { c = nextc(); if (c == -1 || c == '_' || !ISDIGIT(c)) { no_digits(); } } if (c >= '0' && c <= '7') { octal_number: do { if (c == '_') { if (nondigit) break; nondigit = c; continue; } if (c < '0' || c > '9') break; if (c > '7') goto invalid_octal; nondigit = 0; tokadd(c); } while ((c = nextc()) != -1); if (toklen() > start) { pushback(c); tokfix(); if (nondigit) goto trailing_uc; suffix = number_literal_suffix(NUM_SUFFIX_ALL); return set_integer_literal(rb_cstr_to_inum(tok(), 8, FALSE), suffix); } if (nondigit) { pushback(c); goto trailing_uc; } } if (c > '7' && c <= '9') { invalid_octal: yyerror("Invalid octal digit"); } else if (c == '.' || c == 'e' || c == 'E') { tokadd('0'); } else { pushback(c); suffix = number_literal_suffix(NUM_SUFFIX_ALL); return set_integer_literal(INT2FIX(0), suffix); } } for (;;) { switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': nondigit = 0; tokadd(c); break; case '.': if (nondigit) goto trailing_uc; if (seen_point || seen_e) { goto decode_num; } else { int c0 = nextc(); if (c0 == -1 || !ISDIGIT(c0)) { pushback(c0); goto decode_num; } c = c0; } seen_point = toklen(); tokadd('.'); tokadd(c); is_float++; nondigit = 0; break; case 'e': case 'E': if (nondigit) { pushback(c); c = nondigit; goto decode_num; } if (seen_e) { goto decode_num; } nondigit = c; c = nextc(); if (c != '-' && c != '+' && !ISDIGIT(c)) { pushback(c); nondigit = 0; goto decode_num; } tokadd(nondigit); seen_e++; is_float++; tokadd(c); nondigit = (c == '-' || c == '+') ? c : 0; break; case '_': if (nondigit) goto decode_num; nondigit = c; break; default: goto decode_num; } c = nextc(); } decode_num: pushback(c); if (nondigit) { char tmp[30]; trailing_uc: snprintf(tmp, sizeof(tmp), "trailing `%c' in number", nondigit); yyerror(tmp); } tokfix(); if (is_float) { int type = tFLOAT; VALUE v; suffix = number_literal_suffix(seen_e ? NUM_SUFFIX_I : NUM_SUFFIX_ALL); if (suffix & NUM_SUFFIX_R) { char *point = &tok()[seen_point]; size_t fraclen = toklen()-seen_point-1; type = tRATIONAL; memmove(point, point+1, fraclen+1); v = rb_cstr_to_inum(tok(), 10, FALSE); v = rb_rational_new(v, rb_int_positive_pow(10, fraclen)); } else { double d = strtod(tok(), 0); if (errno == ERANGE) { rb_warningS("Float %s out of range", tok()); errno = 0; } v = DBL2NUM(d); } return set_number_literal(v, type, suffix); } suffix = number_literal_suffix(NUM_SUFFIX_ALL); return set_integer_literal(rb_cstr_to_inum(tok(), 10, FALSE), suffix); } case ')': case '] __pad18__ |
| stmt_or_begin __pad5__ |
| command_call __pad9__ |
| keyword_next call_args |
| primary_value tCOLON2 operation2 command_args cmd_brace_block |
| keyword_yield command_args |
| command_call |
| <num> opt_block_param compstmt |
| fixup_nodes& deferred_nodes |
| keyword_not opt_nl expr |
| keyword_BEGIN |
| mlhs_node keyword_variable |
| lhs |
| mlhs_inner mlhs_basic |
| mlhs_item |
| mlhs_post |
| nd_args = $2 |
Definition at line 1382 of file parse.y.
Referenced by dump_node(), and yyparse().
| nd_iter = $1 |
Definition at line 1392 of file parse.y.
Referenced by dump_node(), and yyparse().
| ONIG_EXTERN const unsigned short OnigEncAsciiCtypeTable[] |
| ONIG_EXTERN const UChar OnigEncAsciiToLowerCaseTable[] |
| ONIG_EXTERN const UChar OnigEncAsciiToUpperCaseTable[] |
| ONIG_EXTERN OnigEncoding OnigEncDefaultCharEncoding |
| ONIG_EXTERN const UChar OnigEncISO_8859_1_ToLowerCaseTable[] |
| ONIG_EXTERN const UChar OnigEncISO_8859_1_ToUpperCaseTable[] |
| error stmt |
| stmts terms stmt_or_begin |
| primary_value tCOLON2 operation2 command_args prec tLOWEST |
| error top_stmt |
1.8.2