aboutsummaryrefslogtreecommitdiffstats
path: root/parse.y
Commit message (Collapse)AuthorAgeFilesLines
* * parse.y (reg_named_capture_assign_iter): get rid of creatingnobu2007-12-191-5/+15
| | | | | | | | | 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
* * parse.y (reg_named_capture_assign_iter): remove C99 dependency.nobu2007-12-191-1/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (arg tMATCH arg): call reg_named_capture_assign_gen if regexpakr2007-12-181-0/+82
| | | | | | | | | | | | 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
* * parse.y (op_tbl): remove duplication to avoid symbol aliases.matz2007-12-181-6/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14288 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (parser_encode_length): chomp eol style modifiers.nobu2007-12-171-4/+28
| | | | | | | | | * 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
* * re.c, regerror.c, string.c, parse.y, ruby.c, file.c:akr2007-12-121-1/+1
| | | | | | | | 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
* * parse.y (expr): 'not' and '!' should act as conditionalmatz2007-12-121-3/+3
| | | | | | expression. [ruby-dev:32548] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14198 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (shadowing_lvar_gen): no duplicate error for "_".matz2007-12-101-14/+18
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14186 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (parser_yylex): wrong token was generated. [ruby-dev:32498]matz2007-12-091-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14165 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * re.c (rb_reg_expr_str): use \xHH instead of \OOO.akr2007-12-091-1/+1
| | | | | | | | | | | | | | | | | | * 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
* * parse.y (expr): redefinable not (!) operator.matz2007-12-091-71/+27
| | | | | | | | | | | | * 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
* * parse.y (parser_magic_comment): delimits with a semicolon.nobu2007-12-091-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14150 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * re.c (rb_reg_check_preprocess): new function for validating regexpakr2007-12-081-2/+18
| | | | | | | | | | | 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
* * encoding.c (rb_enc_mbclen): make it never fail.akr2007-12-081-10/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (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
* * parse.y (arg): typo fixed ("!" -> "|") in the ripper code.matz2007-12-071-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14125 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (arg): tUPLUS no longer works as identity operation anymatz2007-12-071-6/+1
| | | | | | more. inspired by [ruby-talk:265532]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14124 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (rb_intern3): fix to changing encoding to default, andnobu2007-12-051-18/+6
| | | | | | | 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
* * parse.y (yycompile): get rid of tracing while parsing.nobu2007-12-051-13/+20
| | | | | | | | | | [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
* * parse.y (parser_tokadd_mbchar): fix for ASCII chars. [ruby-dev:32432]nobu2007-12-021-5/+10
| | | | | | | | * 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
* * parse.y (parser_tokadd_mbchar): check insufficient multibyte char.nobu2007-12-021-9/+12
| | | | | | | [ruby-dev:32429] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14082 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (regexp): fix /#{}\xa1\xa2/e to be EUC-JP. akr2007-12-021-3/+19
| | | | | | | (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
* * include/ruby/intern.h (rb_uv_to_utf8): declared.akr2007-12-011-116/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* * encoding.c: rename primary_encoding -> default_external (encoding).matz2007-12-011-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (newline_node): always remove NODE_BEGIN.nobu2007-11-301-2/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14060 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (stmt): remove unnecessary NODE_BEGIN. [ruby-core:13814]nobu2007-11-291-7/+8
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14045 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/encoding.h, encoding.c, re.c, string.c, parse.y: akr2007-11-271-9/+9
| | | | | | | | | | 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
* * re.c (REG_CASESTATE): unused macro removed.akr2007-11-231-1/+1
| | | | | | | | | | | | (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
* * include/ruby/ruby.h: rename RFloat#double_value -> float_value.ko12007-11-201-1/+1
| | | | | | | | * numeric.c, parse.y: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13986 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (parser_read_escape): has8bit flag may be set with controlnobu2007-11-201-1/+1
| | | | | | | escape. [ruby-core:13722] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13981 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (parser_prepare): set begging after BOM if exists.nobu2007-11-201-0/+1
| | | | | | | [ruby-core:13718] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13980 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (parser_yylex): should clear parser->tokp as well.matz2007-11-191-31/+25
| | | | | | | | | | | | | | [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
* * parse.y (parser_read_escape): disallow control and meta modifiersnobu2007-11-181-2/+2
| | | | | | | for non-ASCII characters. [ruby-core:13685] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13962 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h: introduce 2 macros:ko12007-11-131-2/+2
| | | | | | | | | | | | | | | 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
* * common.mk (parse.c), ext/ripper/depend (ripper.c): process afternobu2007-11-131-32/+41
| | | | | | | | | | | | | | | | | | | | | 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
* * parse.y: use ASCII encoding for string literals that aredavidflanagan2007-11-101-0/+14
| | | | | | | | 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
* * parse.y (parser_nextc): added single line read forward buffer.nobu2007-11-091-15/+20
| | | | | | | * 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
* * parse.y: fix segfault with \x escapes in regexpsdavidflanagan2007-11-081-58/+0
| | | | | | | 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
* * parse.y (parser_read_escape): remove C99/gcc-ism.usa2007-11-081-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13837 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y: patch, based on Nobu's, work to support \u escapesdavidflanagan2007-11-071-81/+331
| | | | | | | | | | 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
* * parse.y (rb_intern3): commented out broken code that preventeddavidflanagan2007-11-071-0/+16
| | | | | | | | | 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
* * parse.y (call_args): remove "parenthesize argument(s) for futurematz2007-11-041-1/+0
| | | | | | | | 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
* * parse.y (bvar): block-local variable can shadow outer variable.nobu2007-10-291-3/+10
| | | | | | | [ruby-core:13036] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * misc/ruby-style.el (ruby-style-{case,label}-indent): adjust fornobu2007-10-261-9/+9
| | | | | | | labels inside switch block. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (parser_yylex): dot at the head of the line denote linematz2007-10-251-0/+19
| | | | | | | | | 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
* * parse.y (parser_tokspace): increment tokidxdavidflanagan2007-10-251-4/+4
| | | | | | | 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
* * parse.y (parser_tokspace): make space in token buffer.nobu2007-10-241-7/+23
| | | | | | | * 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
* * parse.y (call_args2): nd_head of NODE_BLOCK_PASS should be a list.nobu2007-10-231-1/+1
| | | | | | | [ruby-core:12850] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13758 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (parser_regx_options, reg_compile_gen): relaxened encodingnobu2007-10-191-13/+27
| | | | | | | | | | | | | | 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
* * encoding.c (rb_primary_encoding): added Encoding.primary_encoding.nobu2007-10-161-0/+16
| | | | | | | | | | | | | | | | | * 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
* * parse.y (parser_regx_options): check if regexp encoding optionnobu2007-10-161-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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