summaryrefslogtreecommitdiff
path: root/parse.y
AgeCommit message (Collapse)Author
2007-12-19* parse.y (reg_named_capture_assign_iter): get rid of creatingnobu
unnecessary ID. * parse.y (rb_enc_symname2_p): check for non-nul-terminated string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14322 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-19* parse.y (reg_named_capture_assign_iter): remove C99 dependency.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-18* parse.y (arg tMATCH arg): call reg_named_capture_assign_gen if regexpakr
literal is used. (reg_named_capture_assign_gen): assign the result of named capture into local variables. [ruby-dev:32588] * re.c: document the assignment by named captures. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14297 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-18* parse.y (op_tbl): remove duplication to avoid symbol aliases.matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14288 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-17* parse.y (parser_encode_length): chomp eol style modifiers.nobu
* parse.y (parser_magic_comment): ditto. * parse.y (set_file_encoding): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14277 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-12* re.c, regerror.c, string.c, parse.y, ruby.c, file.c:akr
use capital letter for \xHH notation. [ruby-dev:32511] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14202 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-12* parse.y (expr): 'not' and '!' should act as conditionalmatz
expression. [ruby-dev:32548] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14198 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-10* parse.y (shadowing_lvar_gen): no duplicate error for "_".matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14186 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-09* parse.y (parser_yylex): wrong token was generated. [ruby-dev:32498]matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14165 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-09* re.c (rb_reg_expr_str): use \xHH instead of \OOO.akr
* regerror.c (to_ascii): ditto. (onig_snprintf_with_pattern): ditto. (onig_snprintf_with_pattern): ditto. * string.c (rb_str_inspect): ditto. (rb_str_dump): ditto. * parse.y (parser_yylex): ditto. * ruby.c (proc_options): ditto. * file.c (rb_f_test): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14164 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-09* parse.y (expr): redefinable not (!) operator.matz
* parse.y (arg): ditto. * object.c (rb_obj_not): new method "!". * object.c (rb_obj_not_equal): new method "!=". * object.c (rb_obj_not_match): new method "!~". git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14162 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-09* parse.y (parser_magic_comment): delimits with a semicolon.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14150 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-08* re.c (rb_reg_check_preprocess): new function for validating regexpakr
fragment. * parse.y (regexp): invoke reg_fragment_check. (reg_fragment_check): defined. (reg_fragment_check_gen): defined. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14133 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-08* encoding.c (rb_enc_mbclen): make it never fail.akr
(rb_enc_nth): don't check the return value of rb_enc_mbclen. (rb_enc_strlen): ditto. (rb_enc_precise_mbclen): return needmore(1) if e <= p. (rb_enc_get_ascii): new function for extracting ASCII character. * include/ruby/encoding.h (rb_enc_get_ascii): declared. * include/ruby/regex.h (ismbchar): removed. * re.c (rb_reg_expr_str): use rb_enc_get_ascii. (unescape_escaped_nonascii): use rb_enc_precise_mbclen to determine the termination of escaped non-ASCII character. (unescape_nonascii): use rb_enc_precise_mbclen. (rb_reg_quote): use rb_enc_get_ascii. (rb_reg_regsub): use rb_enc_get_ascii. * string.c (rb_str_reverse) don't check the return value of rb_enc_mbclen. (rb_str_split_m): don't call rb_enc_mbclen with e <= p. * parse.y (is_identchar): use ISASCII. (parser_ismbchar): removed. (parser_precise_mbclen): new macro. (parser_isascii): new macro. (parser_tokadd_mbchar): use parser_precise_mbclen to check invalid character precisely. (parser_tokadd_string): use parser_isascii. (parser_yylex): ditto. (is_special_global_name): don't call is_identchar with e <= p. (rb_enc_symname_p): ditto. [ruby-dev:32455] * ext/tk/sample/tkextlib/vu/canvSticker2.rb: remove coding cookie because the encoding is not UTF-8. [ruby-dev:32475] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14131 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-07* parse.y (arg): typo fixed ("!" -> "|") in the ripper code.matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14125 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-07* parse.y (arg): tUPLUS no longer works as identity operation anymatz
more. inspired by [ruby-talk:265532]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14124 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-05* parse.y (rb_intern3): fix to changing encoding to default, andnobu
uncommented r13835, which is rare but not impossible. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14108 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-05* parse.y (yycompile): get rid of tracing while parsing.nobu
[ruby-dev:31351] * thread.c (ruby_suppress_tracing): added a new parameter, which directs to call func always. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14104 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-02* parse.y (parser_tokadd_mbchar): fix for ASCII chars. [ruby-dev:32432]nobu
* parse.y (parser_parse_string, parser_here_document): prevent false error messages. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-02* parse.y (parser_tokadd_mbchar): check insufficient multibyte char.nobu
[ruby-dev:32429] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14082 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-02* parse.y (regexp): fix /#{}\xa1\xa2/e to be EUC-JP. akr
(reg_fragment_setenc_gen): extracted from reg_compile_gen. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14075 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-01* include/ruby/intern.h (rb_uv_to_utf8): declared.akr
* re.c (rb_reg_preprocess): new function for dynamic regexp with \u{} such as Regexp.new("\\u{6666}"). (rb_reg_prepare_re): preprocess regexp for recompiling. (read_escaped_byte): new function. (unescape_escaped_nonascii): new function. (append_utf8): new function. (unescape_unicode_list): new function. (unescape_unicode_bmp): new function. (unescape_nonascii): new function. (rb_reg_initialize): preprocess regexp. * pack.c (rb_uv_to_utf8): renamed from uv_to_utf8. * parse.y (STR_NEW3): take func instead of has8 and hasmb. (parser_str_new): use default coderange mechanism except for regexp. (parser_tokadd_utf8): copy regexp source as-is. (parser_read_escape): UTF-8 stuff removed. (parser_tokadd_escape): has8bit and hasmb removed. (parser_tokadd_string): fix 8-bit single byte character with \u. (parser_parse_string): has8bit and hasmb removed. (parser_here_document): has8bit and hasmb removed. (parser_yylex): call parser_tokadd_utf8 instead of read_escape for UTF-8 character. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14072 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-01* encoding.c: rename primary_encoding -> default_external (encoding).matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-30* parse.y (newline_node): always remove NODE_BEGIN.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14060 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-29* parse.y (stmt): remove unnecessary NODE_BEGIN. [ruby-core:13814]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14045 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-27* include/ruby/encoding.h, encoding.c, re.c, string.c, parse.y: akr
rename ENC_CODERANGE_SINGLE to ENC_CODERANGE_7BIT. rename ENC_CODERANGE_MULTI to ENC_CODERANGE_8BIT. Because single byte 8bit character, such as Shift_JIS 1byte katakana, is represented by ENC_CODERANGE_MULTI even if it is not multi byte. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14027 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-23* re.c (REG_CASESTATE): unused macro removed.akr
(rb_reg_prepare_re): check encoding difference. (rb_reg_initialize): check 8bit byte. * parse.y (parser_tokadd_escape): fix has8bit. [ruby-dev:32113] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14002 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-20* include/ruby/ruby.h: rename RFloat#double_value -> float_value.ko1
* numeric.c, parse.y: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13986 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-20* parse.y (parser_read_escape): has8bit flag may be set with controlnobu
escape. [ruby-core:13722] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13981 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-20* parse.y (parser_prepare): set begging after BOM if exists.nobu
[ruby-core:13718] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13980 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-19* parse.y (parser_yylex): should clear parser->tokp as well.matz
[ruby-dev:32250] * parse.y: remove NEED_ASSOC that break test_parser_events. * parse.y (parser_yylex): should not decrement line numbers at the end of file. * file.c (rb_find_file_ext): search .rb files first through in the loadpath. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13966 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-18* parse.y (parser_read_escape): disallow control and meta modifiersnobu
for non-ASCII characters. [ruby-core:13685] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13962 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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