aboutsummaryrefslogtreecommitdiffstats
path: root/parse.y
Commit message (Collapse)AuthorAgeFilesLines
* parse.y: expand is_asgn_or_idnobu2014-07-081-7/+7
| | | | | | | * 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
* * parse.y (dsymbol_alloc): set global_symbols.minor_marked to 0.ko12014-07-081-8/+21
| | | | | | | | | | | * 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
* * parse.y: remove global_symbols::pinned_dsymko12014-07-071-16/+12
| | | | | | | | | | | (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
* * parse.y: need to use updated (re-created) symbols.ko12014-07-071-4/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46737 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y: do not use rb_gc_resurrect(), but create a new dynamicko12014-07-071-25/+42
| | | | | | | | | 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
* parse.y: fix castsnobu2014-07-041-7/+7
| | | | | | | | | * 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
* * parse.y: rename symbols::sym_id to symbols::str_id.ko12014-07-041-18/+19
| | | | | | | | | | | 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
* * parse.y (must_be_dynamic_symbol): fix missed-condition.ko12014-07-041-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46695 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (rb_pin_dynamic_symbol): should be `static' function.ko12014-07-041-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46694 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (must_be_dynamic_symbol): refactoring.ko12014-07-041-8/+15
| | | | | | | | | | | * 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
* parse.y: remove global_symbols.op_symnobu2014-07-041-22/+5
| | | | | | | * 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
* parse.y: use rb_fstring_newnobu2014-07-041-6/+5
| | | | | | | * 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
* parse.y: pack op_tblnobu2014-07-041-2/+2
| | | | | | | | * 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
* * parse.y: remove unused codeko12014-07-041-39/+0
| | | | | | | | srounded by `#if ENABLE_SELECTOR_NAMESPACE' git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46685 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* node.h: remove NODE_PRIVATE_RECVnobu2014-06-061-14/+2
| | | | | | | | * 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
* compile.c, parse.y: private op assignnobu2014-06-061-2/+3
| | | | | | | | * 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
* parse.y: attr_receivernobu2014-06-061-2/+2
| | | | | | * parse.y (aryset_gen): use `attr_receiver()`. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46362 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* node.h: NODE_PRIVATE_RECVnobu2014-06-061-2/+9
| | | | | | | | | | * 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
* configure.in, missing.h: jemalloc manglingnobu2014-06-051-0/+4
| | | | | | | | | | | | * 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
* encoding.h: constify rb_encodingnobu2014-06-021-10/+10
| | | | | | | * include/ruby/encoding.h: constify `rb_encoding` itself, not only arguments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46322 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* constify rb_encoding and OnigEncodingnobu2014-06-011-9/+9
| | | | | | | * include/ruby/encoding.h: constify `rb_encoding` arguments. * include/ruby/oniguruma.h: constify `OnigEncoding` arguments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46309 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: no duplicate attrset IDnobu2014-05-311-1/+3
| | | | | | | | * parse.y (intern_str): dynamic attrset ID is registered by `rb_id_attrset()` already, so no further registration is needed. [ruby-core:62861] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46289 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* remove empty rb_gc_mark_parser functionnormal2014-05-291-5/+0
| | | | | | | | * parse.y (rb_gc_mark_parser): remove, empty since r8758 * internal.h: ditto, not usable from extensions since 2.0.0 * gc.c (gc_mark_roots): remove checkpoint for parser git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46239 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: refine error messagenobu2014-05-271-0/+10
| | | | | | | * parse.y (parser_number_literal_suffix): refine error message for extra dot and digits. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46179 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: no duplicated namesnobu2014-05-061-4/+12
| | | | | | | * parse.y (new_bv_gen): no duplicated names, if already added in shadowing_lvar(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45846 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: remove duplicated namesnobu2014-05-061-18/+13
| | | | | | | * parse.y (local_tbl_gen): remove local variables duplicated with arguments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45845 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: unused return valuesnobu2014-05-061-6/+4
| | | | | | | * parse.y (arg_var_gen, local_var_gen): make void since the result values are not used. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45844 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: fix wrong static symbolnobu2014-05-021-1/+0
| | | | | | | | * parse.y (next_id): no reason to set ID_STATIC_SYM here, as ID returned by rb_intern3 can be a dynamic symbol and the static symbol flag is set otherwise. [Bug #9787] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45788 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: hide anonymous idnobu2014-05-021-2/+2
| | | | | | | * parse.y (rb_id_attrset): should not reveal anonymous ID as an instance variable. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: turn dynamically interned Symbol into an IDnobu2014-05-021-6/+1
| | | | | | | | * parse.y (rb_id_attrset): turn dynamically interned Symbol into an ID, since rb_str_dynamic_intern returns a Symbol but not an ID. [ruby-core:62226] [Bug #9787] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45782 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: abort at inappropriate symbolnobu2014-05-011-4/+5
| | | | | | | * parse.y (must_be_dynamic_symbol): abort if inappropriate symbol is given, which should never happen. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45777 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: show symbol namenobu2014-05-011-0/+3
| | | | | | | * parse.y (must_be_dynamic_symbol): show the name if it is a static symbol. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45771 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: show name as possiblenobu2014-04-301-2/+12
| | | | | | | * parse.y (rb_id_attrset): show the name of broken ID if it is still registered. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45767 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: raise with numeric ID typenobu2014-04-301-14/+2
| | | | | | | | * parse.y (rb_id_attrset): all valid ID types are handled properly, raise with numeric ID type which may be broken for GCed static symbol. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: use rb_id2strnobu2014-04-301-3/+4
| | | | | | * parse.y (rb_id_attrset): use rb_id2str to get rid of method call. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45764 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: use rb_str_ellipsizenobu2014-04-301-8/+3
| | | | | | | * parse.y (next_id): use rb_str_ellipsize to preserve encoding and get rid of incomplete multibyte sequence. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45761 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: pin down dynamic symbol onlynobu2014-04-301-13/+16
| | | | | | | | | | * parse.y (rb_id_attrset): pin down dynamic symbol only. it is possibe that attrset ID can be registered as a static symbol after the corresponding attrget ID has been registered as a dynamic, and then the latter may be collected. [ruby-core:62226] [Bug #9787] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45756 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (symbols_i): like r45492, call rb_gc_resurrect().ktsj2014-04-291-2/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: resurrect dynamic symbol and namenobu2014-04-241-0/+2
| | | | | | | * parse.y (lookup_id_str): resurrect the dynamic symbol before accessing its content, and its name before returning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45703 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: check for symbolnobu2014-04-241-8/+13
| | | | | | | * parse.y (rb_sym2id, rb_sym2id_without_pindown): reject non-symbol values. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45702 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: check for symbolnobu2014-04-241-2/+8
| | | | | | | * parse.y (rb_sym2id, rb_sym2id_without_pindown): return 0 for non-symbol values, for the time being. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: resurrect before pindownnobu2014-04-241-3/+1
| | | | | | | | | | | * parse.y (rb_pin_dynamic_symbol): resurrect the dynamic symbol which may be unmarked already and swept at next time, before pindown. * parse.y (dsym_node_gen): now rb_intern_str() resurrects dynamic symbols, via lookup_sym_id() and rb_pin_dynamic_symbol(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45698 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: trivial optimizationnobu2014-04-241-1/+1
| | | | | | | * parse.y (rb_str_dynamic_intern): branch by same condition as rb_id2sym to reduce unnecessary branch. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45697 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (dsym_node_gen): like r45492, call rb_gc_resurrect().naruse2014-04-231-0/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45693 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: allow parenthesed do-block in cmdargnobu2014-04-191-3/+9
| | | | | | | | * parse.y (primary): flush cmdarg flags inside left-paren in a command argument, to allow parenthesed do-block as an argument without arguments parentheses. [ruby-core:61950] [Bug #9726] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45637 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: shared substring of sourcenobu2014-04-181-11/+11
| | | | | | | * parse.y (lex_get_str): return shared sub-string of entire source string instead of a partial copy. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45629 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (rb_str_dynamic_intern): set mark bit if dynamic symbolktsj2014-04-011-1/+7
| | | | | | is before sweeping. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (rb_str_dynamic_intern): [DOC] move rdoc from rb_str_intern.ktsj2014-03-301-0/+20
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45469 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: rb_id_attrgetnobu2014-03-281-1/+20
| | | | | | | * parse.y (rb_id_attrget): new function to convert setter ID to getter ID. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45464 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* parse.y: type-punning castnobu2014-03-271-2/+5
| | | | | | | * parse.y (rb_gc_free_dsymbol): use intermediate st_data_t and get rid of type-punning cast. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45443 b2dd03c8-39d4-4d8f-98ff-823fe69b080e