summaryrefslogtreecommitdiff
path: root/parse.y
AgeCommit message (Collapse)Author
2007-11-13* include/ruby/ruby.h: introduce 2 macros:ko1
RFLOAT_VALUE(v), DOUBLE2NUM(dbl). Rename RFloat#value -> RFloat#double_value. Do not touch RFloat#double_value directly. * bignum.c, insns.def, marshal.c, math.c, numeric.c, object.c, pack.c, parse.y, process.c, random.c, sprintf.c, string.c, time.c: apply above changes. * ext/dl/mkcallback.rb, ext/json/ext/generator/generator.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13913 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-13* common.mk (parse.c), ext/ripper/depend (ripper.c): process afternobu
bison with sed. [ruby-dev:32204] * ruby.c (proc_options): use yydebug in cmdline_options. * ruby.c (process_options): set yydebug flag of parser. * parse.y (yydebug): moved into struct parser_params. * parse.y (rb_parser_get_yydebug, rb_parser_set_yydebug): parser generic methods. * */Makefile.sub (parse.c): moved to common.mk. * tool/ytab.sed: comment out yydebug definition, and substitute yyerror with parser_yyerror. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13908 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-10* parse.y: use ASCII encoding for string literals that aredavidflanagan
7-bit clean, fixing regression from my previous patch git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13860 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-09* parse.y (parser_nextc): added single line read forward buffer.nobu
* parse.y (parser_yylex): adjust line number for fluent interface. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13858 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-08* parse.y: fix segfault with \x escapes in regexpsdavidflanagan
delete unused #if 0 code regions from previous patch git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13838 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-08 * parse.y (parser_read_escape): remove C99/gcc-ism.usa
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13837 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-07* parse.y: patch, based on Nobu's, work to support \u escapesdavidflanagan
also modifications for better coderange detection * test/ruby/test_unicode_escapes.rb: test cases * test/ruby/test_mixed_unicode_escapes.rb: mixed encoding test cases git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13836 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-07* parse.y (rb_intern3): commented out broken code that preventeddavidflanagan
correct interning of multi-byte symbols. Without this patch :x==:x is false when x is a multi-byte character. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13835 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-04* parse.y (call_args): remove "parenthesize argument(s) for futurematz
version" warning. when I added this warning, I had a plan to reimplement the parser that is simpler than the current one. since we abandoned the plan, warning no longer required. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13821 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-29* parse.y (bvar): block-local variable can shadow outer variable.nobu
[ruby-core:13036] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-26* misc/ruby-style.el (ruby-style-{case,label}-indent): adjust fornobu
labels inside switch block. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-25* parse.y (parser_yylex): dot at the head of the line denote linematz
continuation from previous one to support fluent interface. [experimental] * misc/ruby-mode.el (ruby-calculate-indent): support fluent dot. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13777 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-25* parse.y (parser_tokspace): increment tokidxdavidflanagan
fixes test failure at [test/ruby/test_stringchar.rb:72] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13773 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-24* parse.y (parser_tokspace): make space in token buffer.nobu
* parse.y (parser_yylex): fix encoding of single character literal. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-23* parse.y (call_args2): nd_head of NODE_BLOCK_PASS should be a list.nobu
[ruby-core:12850] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13758 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-19* parse.y (parser_regx_options, reg_compile_gen): relaxened encodingnobu
matching rule. * re.c (rb_reg_initialize): always set encoding of Regexp. * re.c (rb_reg_initialize_str): fix enconding for non 7bit-clean strings. * re.c (rb_reg_initialize_m): use ascii encoding for 'n' option. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-16* encoding.c (rb_primary_encoding): added Encoding.primary_encoding.nobu
* parse.y (rb_parser_encoding): added. * ruby.c (proc_options): added -E and --encoding options. * ruby.c (process_options): set primary encoding from command line option if set, or source encoding. * include/ruby/encoding.h (rb_enc_from_encoding, rb_get_primary_encoding, rb_set_primary_encoding): prototypes. * include/ruby/node.h (rb_parser_encoding): prototype. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13729 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-16* parse.y (parser_regx_options): check if regexp encoding optionnobu
matches to current encoding. * re.c (char_to_option, rb_char_to_option_kcode): 'n' is not kcode option now. * re.c (rb_reg_to_s, rb_reg_error_desc): copy encoding rather than append as an option. * re.c (make_regexp, rb_reg_prepare_re): use encoding of Regexp and String instead of kcode. * re.c (rb_reg_initialize): set fixed option if none is set. * re.c (rb_reg_regcomp): ditto. * re.c (rb_reg_equal): check if encodings are equal. * re.c (rb_reg_initialize_m): encoding option is obsolete. * re.c (rb_kcode, rb_get_kcode, rb_set_kcode): removed. * re.c (Init_Regexp): removed Regexp#kcode method. * ruby.c (proc_options): allow long encoding name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13717 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-13* parse.y (set_file_encoding): case-insensitive search, a patch fromnobu
David Flanagan <david AT davidflanagan.com> [ruby-core:12629] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13689 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-12* parse.y: encoding specifier should work if the line matchesmatz
/coding[:=] ?/, a la Python PEP-263, so that VIM comments like "# vim: set fileencoding=<encoding name>" should be recognized. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13685 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-12* trunk/parse.y (magic_comments): add "encoding" as same as "coding".nobu
* trunk/parse.y (set_file_encoding): special file encoding handling. * trunk/parse.y (parser_yylex): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13681 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-09 * parse.y (parser_read_escape, parser_tokadd_escape): check code range.usa
[ruby-dev:31980] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13663 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-09* parse.y (STR_NEW3): check for if single byte sequence.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13661 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-04* parse.y (reg_compile_gen): copy encoding from source string ifnobu
non-empty. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13615 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-04* parse.y (reg_compile_gen): copy encoding from source string.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13614 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-03* parse.y (parser_str_new, parser_yylex, rb_intern3): set code-rangenobu
bits. * parse.y (parser_tokadd_string): check code-range. * parse.y (parser_parse_string, parser_here_document): ditto. * parse.y (parser_set_encode): check if valid encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13606 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-28* io.c (rb_io_fdopen): create IO object from fd.nobu
* parse.y (yycompile): use encoding of the source as default. * ruby.c (proc_options, load_file): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13557 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-27* parse.y (strings, xstring, regexp, dsym): empty strings havenobu
US-ASCII encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13533 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-26* encoding.c (rb_enc_associate_index): deal with ASCII compatiblenobu
flags. * encoding.c (rb_enc_check): allow ASCII compatible strings. * parse.y (rb_intern_str): use ASCII encoding for ASCII string. * string.c (rb_enc_str_coderange): check for code-range. * string.c (rb_str_modify): clear code-range flags. * string.c (rb_str_hash, rb_str_eql): ASCII compatible strings are comparable. * include/ruby/encoding.h: added code-range flags. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13529 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-26* encoding.c (rb_enc_check): check for ASCII-compatibilities.nobu
* parse.y (parser_tokadd_string, parser_parse_string, parser_here_document, parser_yylex): set encoding to US-ASCII. * parse.y (rb_enc_symname_p): check if valid with encoding. * parse.y (rb_intern3): let symbols have encoding. * string.c (rb_str_hash): add encoding index. * string.c (rb_str_comparable, rb_str_equal, rb_str_eql): check if compatible encoding. * string.c (sym_inspect): made encoding aware. * insns.def (opt_eq): compare with encoding. * include/ruby/encoding.h (rb_enc_asciicompat): check if ASCII compatible. * include/ruby/encoding.h (rb_enc_get_index): added prototype. * include/ruby/intern.h (rb_str_comparable, rb_str_equal): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13518 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-25* parse.y (parser_yyerror): limit error message length.nobu
[ruby-dev:31848] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13514 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-22* eval_method.ci (rb_attr): should not use alloca for unknowen sizenobu
input. [ruby-dev:31816] * parse.y (rb_intern_str): prevent str from optimization. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13494 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-17* parse.y (ripper): rename event: arglist_* -> args_*.aamine
* parse.y (ripper): rename event: restparam -> rest_param. * parse.y (ripper): rename event: constpath_* -> const_path_*. * parse.y (ripper): rename event: topconst_* -> top_const_*. * parse.y (ripper): rename event: iter_block -> method_add_block. * parse.y (ripper): support block local parameter declaration. * parse.y (ripper): introduce new macro params_new. * ext/ripper/lib/ripper/sexp.rb: should not dispose event arguments whose name ends with "_new" but arity != 0. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13465 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-15* parse.y (struct parser_params): common members in the parser andnobu
ripper must be placed at each same location. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13450 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-15* parse.y (parser_initialize): set default encoding. [ruby-dev:31787]nobu
* ruby.c (load_file): make new parse instance after processing shebang line options. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13448 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-13* parse.y (brace_block): should use compstmt. patch submitted bynobu
Kirill A. Shutemov <k.shutemov AT gmail.com> [ruby-core:12154]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-13* parse.y (rb_id2str): fixed typo.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13435 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-12* io.c (rb_io_s_sysopen): should not use alloca for unknowen sizenobu
input. [ruby-dev:31775] * parse.y (rb_id2str): ditto. * marshal.c (w_float): use snprintf instead of sprintf. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13430 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-06* array.c (rb_ary_cycle): typo in rdoc. a patch from Yuguimatz
<yugui@yugui.sakura.ne.jp>. [ruby-dev:31748] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13348 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-30* parse.y (f_norm_arg, f_arg_item): not croak already erred names.nobu
[ruby-dev:31687] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13322 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-30* parse.y (assignable_gen): ignore already erred names.nobu
* parse.y (shadowing_lvar_gen): always make new block local variable when shadowing outer local variable. [ruby-dev:31507] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-29* parse.y (aref_args): args may not be a list. [ruby-dev:31592]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13301 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-28* parse.y (parser_prepare): set parser encode too when BOM exists.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13292 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-25* parse.y, re.c: re-applied revision 13092.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13267 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-25* encoding.c: provide basic features for M17N.matz
* parse.y: encoding aware parsing. * parse.y (pragma_encoding): encoding specification pragma. * parse.y (rb_intern3): encoding specified symbols. * string.c (rb_str_length): length based on characters. for older behavior, bytesize method added. * string.c (rb_str_index_m): index based on characters. rindex as well. * string.c (succ_char): encoding aware succeeding string. * string.c (rb_str_reverse): reverse based on characters. * string.c (rb_str_inspect): encoding aware string description. * string.c (rb_str_upcase_bang): encoding aware case conversion. downcase, capitalize, swapcase as well. * string.c (rb_str_tr_bang): tr based on characters. delete, squeeze, tr_s, count as well. * string.c (rb_str_split_m): split based on characters. * string.c (rb_str_each_line): encoding aware each_line. * string.c (rb_str_each_char): added. iteration based on characters. * string.c (rb_str_strip_bang): encoding aware whitespace stripping. lstrip, rstrip as well. * string.c (rb_str_justify): encoding aware justifying (ljust, rjust, center). * string.c (str_encoding): get encoding attribute from a string. * re.c (rb_reg_initialize): encoding aware regular expression * sprintf.c (rb_str_format): formatting (i.e. length count) based on characters. * io.c (rb_io_getc): getc to return one-character string. for older behavior, getbyte method added. * ext/stringio/stringio.c (strio_getc): ditto. * io.c (rb_io_ungetc): allow pushing arbitrary string at the current reading point. * ext/stringio/stringio.c (strio_ungetc): ditto. * ext/strscan/strscan.c: encoding support. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-23* compile.c, insns.def, parse.y: fix massign order. This changeko1
causes performance problem. Try vm1_swap benchmark. [ruby-dev:31522] * insns.def, insnhelper.ci: move process body of expandarray insn to vm_expandarray(). * bootstraptest/test_knownbug.rb, bootstraptest/test_massign.rb: move a solved test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13236 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-23* parse.y (f_norm_arg): ripper has no shadowing check.nobu
* parse.y (f_block_arg): dispatch blkarg_mark. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-23* parse.y (f_norm_arg): check also nested arguments. [ruby-dev:31502]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13233 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-18* parse.y (reg_compile_gen): obtain error info from errinfo.nobu
* re.c (rb_reg_error_desc): make RegexpError for initialization error. * re.c (rb_reg_compile): return nil and set errinfo if error. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13092 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-15* parse.y: remove "//" type comment.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12939 b2dd03c8-39d4-4d8f-98ff-823fe69b080e