summaryrefslogtreecommitdiff
path: root/parse.y
AgeCommit message (Collapse)Author
2014-10-04parse.y: remove unused argumentnobu
* parse.y (list_concat): remove unused argument parser, since never allocates new node. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47789 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-30parse.y: separate ripper data typenobu
* parse.y (parser_data_type): separate ripper data type for from parser. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47747 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-23parse.y: label cannot be followed by a modifiernobu
* parse.y (parse_ident): just after a label, new expression should start, cannot be a modifier. [ruby-core:65211] [Bug #10279] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47696 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-21* parse.y (parser_class_nest): unused variable after YARVnari
merged (r11439). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47674 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-20parse.y: quoted ID keynobu
* parse.y (assoc): allow quoted ID as a key of a hash literal. [ruby-core:34453] [Feature #4276] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47649 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-13parse.y: intern_cstrnobu
* parse.y (intern_cstr): remove `_without_pindown` suffix and use rb_intern3() as well as RIPPER, for the time being. [ruby-core:65009] [Bug #10206] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47569 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-06parse.y: fix warning messagenobu
* parse.y (arg_ambiguous_gen): fix warning message, "even" does not mean the number of spaces here. state the place to put a space and the operator. [ruby-core:64790] [Bug #10204] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-27parse.y: use rb_ary_tmp_new_fillnobu
* parse.y (coverage): use rb_ary_tmp_new_fill() instead of setting internal structure directly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47296 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-14parser.y: warning with VALUE for rippernobu
* parse.y (ripper_warnV, ripper_warningV): add versions using VALUE for ripper. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47184 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-13parse.y: preserve encodingsnobu
* parse.y (shadowing_lvar, warn_unused_var), (reg_named_capture_assign_iter): preserve encodings in warning messages. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47171 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-07parse.y: fix invalid char in evalnobu
* parse.y (parser_yylex): fix invalid char in eval, should raise an syntax error too, as well as directly coded. [ruby-core:64243] [Bug #10117] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47098 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-06parse.y: preserve encodingnobu
* parse.y (parser_yyerror): preserve source code encoding in syntax error messages. [ruby-core:64228] [Bug #10114] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47090 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-25struct parse_params: trivial packingnormal
* parse.y (struct parse_params): shrink to 320 to 304 bytes on 64-bit Some elements may be removed/resized as well, but not as important as reducing more-frequently allocated structures. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46954 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-25introduce ZALLOC{,_N} to replace ALLOC{,_N}+MEMZERO usenormal
Using calloc where possible reduces code and binary sizes. * include/ruby/ruby.h (ZALLOC, ZALLOC_N): implement (Data_Make_Struct, TypedData_Make_Struct): ZALLOC replaces ALLOC+memset * compile.c (iseq_seq_sequence): ZALLOC_N replaces ALLOC_N+MEMZERO * cont.c (fiber_t_alloc): ZALLOC replaces ALLOC+MEMZERO * io.c (rb_io_reopen): ditto * iseq.c (prepare_iseq_build): ditto * parse.y (new_args_tail_gen, parser_new, ripper_s_allocate): ditto * re.c (match_alloc): ditto * variable.c (rb_const_set): ditto * ext/socket/raddrinfo.c (get_addrinfo): ditto * ext/strscan/strscan.c (strscan_s_allocate): ditto * gc.c (rb_objspace_alloc): calloc replaces malloc+MEMZERO git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46952 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-24parse.y: dynamic const assign_error in rippernobu
* parse.y (mlhs_node): dynamic constant assignment in massign should cause assign_error, like as single assign and backref assignment in massign. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46931 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-24parse.y: move common codenobu
* parse.y (arg, primary): move common code shared with ripper. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-24parse.y: remove garbagenobu
* parse.y (assoc): remove garbage semicolon added by r35489. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46926 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-17parse.y: separate from parse_identnobu
* parse.y (tokadd_ident, tokenize_ident): extract from parse_ident(). * parse.y (parse_gvar, parse_atmark): move tokenization from parse_ident(). * parse.y (parse_ident): now deals with non-sigil names only. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46850 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-17parse.y: parse_atmarknobu
* parse.y (parse_atmark): extract from parser_yylex(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46849 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-17parse.y: parse_identnobu
* parse.y (parse_ident): extract from parser_yylex(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46848 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-17parse.y: parse_gvarnobu
* parse.y (parse_gvar): extract from parser_yylex(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46847 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-17parse.y: parse_percentnobu
* parse.y (parse_percent): extract from parser_yylex(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46846 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-17parse.y: parse_qmarknobu
* parse.y (parse_qmark): extract from parser_yylex(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46845 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-17parse.y: parse_rationalnobu
* parse.y (parse_rational): extract from parse_numeric(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46844 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-17parse.y: parse_numericnobu
* parse.y (parse_numeric): extract from parser_yylex(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46842 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-17parse.y: negate_litnobu
* parse.y (negate_lit): alter only literal object itself, not NODE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46841 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-11parse.y: rename Init_parsernobu
* parse.y (rb_init_parse): rename to get rid of name clash with json/parser at statically linking. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46787 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-09symbol.c, symbol.h: split from parse.ynobu
* symbol.c, symbol.h: Symbol class implementation and internals, split from parse.y. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46768 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-09parse.y: adjust argument typesnobu
* parse.y (symbols_i): adjust argument types for st_foreach() using st_data_t. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46767 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-09* parse.y: change Symbol <-> ID relationship to avoidko1
exposing IDs from collectable symbols. [Bug #10014] Now, rb_check_id() returns 0 if corresponding symbol is pinned dynamic symbol. There is remaining intern_cstr_without_pindown(), it can return IDs from collectable symbols. We must be careful to use it (only used in parse.y). I think it should be removed if it does not have impact for performance. * parse.y: add: * STATIC_SYM2ID() * STATIC_ID2SYM() rename: * rb_pin_dynamic_symbol() -> dsymbol_pindown() * internal.h: remove: * rb_check_id_without_pindown() * rb_sym2id_without_pindown() add: * rb_check_symbol() * rb_check_symbol_cstr() * load.c: use rb_check_id() or rb_check_id_cstr(). * object.c: ditto. * struct.c: ditto. * thread.c: ditto. * vm_method.c: ditto. * string.c (sym_find): use only rb_check_symbol(). * sprintf.c (rb_str_format): use rb_check_symbol_cstr(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46764 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-09* parse.y (symbols_i): delete garbage symbols for Symbol.all_symbols.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-08parse.y: expand is_asgn_or_idnobu
* parse.y (new_op_assign_gen): expand is_asgn_or_id(), which call id_type() function multiple times now. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46754 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-08* parse.y (dsymbol_alloc): set global_symbols.minor_marked to 0.ko1
* parse.y (dsymbol_check): set RSYMBOL(sym)->fstr to 0 because we should not touch fstr after that. * parse.y (rb_gc_free_dsymbol): skip deleting str and sym from tables if fstr == 0. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46752 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-07* parse.y: remove global_symbols::pinned_dsymko1
(and ::pinned_dsym_minor_marked). Mark pinned dsymbols by rb_gc_register_mark_object() because they are immortal. * prase.y (rb_gc_free_dsymbol): rename parameter name `ptr' to `sym'. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46749 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-07* parse.y: need to use updated (re-created) symbols.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46737 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-07* parse.y: do not use rb_gc_resurrect(), but create a new dynamicko1
symbol for garbage dynamic symbol. * common.mk: use gc.h by parse.y. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46729 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-04parse.y: fix castsnobu
* parse.y (reg_named_capture_assign_gen): remove needless cast. * parse.y (must_be_dynamic_symbol, intern_cstr_without_pindown): get rid of type-punning cast. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46697 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-04* parse.y: rename symbols::sym_id to symbols::str_id.ko1
This table is not {Symbol => ID} table, but {String => ID} table. * parse.y (lookup_sym_id): also rename lookup_sym_id() to lookup_str_id() because key is not Symbol, but String. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46696 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-04* parse.y (must_be_dynamic_symbol): fix missed-condition.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46695 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-04* parse.y (rb_pin_dynamic_symbol): should be `static' function.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46694 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-04* parse.y (must_be_dynamic_symbol): refactoring.ko1
* add `inline'. * use UNLIKELY(). * check only DYNAMIC_SYM_P(), otherwise it is a bug. * lookup_id_str() is not needed in second condition. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46693 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-04parse.y: remove global_symbols.op_symnobu
* parse.y (global_symbols): remove op_sym, cache by fstring instead. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-04parse.y: use rb_fstring_newnobu
* parse.y (rb_id2str): use rb_fstring_new() instead of rb_fstring() with a new string instance. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46690 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-04parse.y: pack op_tblnobu
* parse.y (op_tbl): pack limited size strings. gcc/clang warn if initializer-string for char array is too long, but no option to err it now. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46688 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-04* parse.y: remove unused codeko1
srounded by `#if ENABLE_SELECTOR_NAMESPACE' git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46685 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-06node.h: remove NODE_PRIVATE_RECVnobu
* compile.c (private_recv_p): check by node type, instead of a magic number. * node.h (NODE_PRIVATE_RECV), parse.y (attrset_gen): remove git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46366 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-06compile.c, parse.y: private op assignnobu
* compile.c (iseq_compile_each), parse.y (new_attr_op_assign_gen): allow op assign to a private attribute. [ruby-core:62949] [Bug #9907] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46365 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-06parse.y: attr_receivernobu
* parse.y (aryset_gen): use `attr_receiver()`. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46362 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-06node.h: NODE_PRIVATE_RECVnobu
* node.h (NODE_PRIVATE_RECV): name a magic number, `self` as the receiver of a setter method call. * compile.c (private_recv_p), parse.y (attr_receiver): use the named macro. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46361 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-05configure.in, missing.h: jemalloc manglingnobu
* configure.in (with-jemalloc): also check for header, for ABIs which JEMALLOC_MANGLE is needed, i.e., Mach-O and PE-COFF platforms. [ruby-core:62939] [Feature #9113] * include/ruby/missing.h: include alternative malloc header to replace memory management functions. * dln.c, io.c, parse.y, st.c: undef malloc family before re-definition to suppress warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46354 b2dd03c8-39d4-4d8f-98ff-823fe69b080e