summaryrefslogtreecommitdiffstats
path: root/parse.y
Commit message (Collapse)AuthorAgeFilesLines
* * parse.y (parser_magic_comment): use STRNCASECMP.akr2008-01-031-2/+2
| | | | | | | (set_file_encoding): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14863 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (program, yycompile0): too early to drop lex_lastline innobu2007-12-301-2/+2
| | | | | | | rules. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14798 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (program): clear input strings after all process.nobu2007-12-301-6/+9
| | | | | | | | * parse.y (parser_nextc, parser_yylex): should not drop lex_lastline while lex_p is valid. [ruby-dev:32896] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14793 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y, transcode_data.h, transcode.c: change "illegal" toakr2007-12-271-1/+1
| | | | | | | | "invalid" in a context which doesn' t against a law. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14735 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (struct parser_params): make parser_ruby_sourcefile commonakr2007-12-251-9/+22
| | | | | | | | | | field. it is used by node_newnode. new field parser_ruby_sourcefile_string for ripper. (parser_initialize): initialize parser_ruby_sourcefile in ripper. (ripper_initialize): initialize parser_ruby_sourcefile_string. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14698 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (rb_id2str): fill klass of returned string as rb_cString.akr2007-12-241-4/+12
| | | | | | | | | some strings are allocated before rb_cString is created. This prevents a "called on terminated object" error by ObjectSpace.each_object(Module) {|m| p m.name }. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14631 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/encoding.h, encoding.c, re.c, io.c, parse.y, numeric.c,akr2007-12-221-3/+3
| | | | | | | | | ruby.c, transcode.c: rename rb_ascii_encoding. to rb_ascii8bit_encoding. rb_ascii_encoding is ambiguous with ASCII-8BIT and US-ASCII. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14504 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (reg_named_capture_assign_iter): allows non-ascii names andnobu2007-12-221-2/+2
| | | | | | | get rid of reserved word IDs. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14462 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (reg_named_capture_assign_iter): just ignore thematz2007-12-221-2/+0
| | | | | | captures that do not have valid local variable name. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14452 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (reg_named_capture_assign_iter): captured name shouldmatz2007-12-221-1/+2
| | | | | | | not be reserved word. a patch from Keita Yamaguchi <keita.yamaguchi AT gmail.com> in [ruby-dev:32675]. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14450 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (parser_str_new, rb_intern3): rb_default_encoding() renamed.usa2007-12-211-3/+3
| | | | | | | | * ext/nkf/nkf.c (rb_nkf_putchar): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14444 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (command): block from cmd_brace_block was ignored.matz2007-12-211-3/+6
| | | | | | [ruby-dev:32644] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (rb_enc_init): use enc_register_at() directly.nobu2007-12-211-1/+1
| | | | | | | | | | | * encoding.c (rb_utf8_encoding): returns utf-8 encoding. * include/ruby/encoding.h (rb_utf8_encoding): prototyped. * parse.y (UTF8_ENC): uses rb_utf8_encoding(). git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14410 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * keywords, parse.y (__ENCODING__): represent script encoding.nobu2007-12-211-1/+7
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14384 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * regerror.c, string.c, io.c, lib/getoptlong.rb, lib/net/imap.rb,akr2007-12-211-2/+2
| | | | | | | | | | | compile.c, sprintf.c, parse.y, ext/win32ole/win32ole.c, ext/tk/sample/demos-en/entry3.rb, ext/tk/lib/tcltk.rb, ext/openssl/ossl_bn.c, numeric.c, vm.c, benchmark/bm_so_meteor_contest.rb, bignum.c, ruby.c: don't "illegal" for non law violation context. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14377 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/ruby/trunk@14072 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c: rename primary_encoding -> default_external (encoding).matz2007-12-011-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (newline_node): always remove NODE_BEGIN.nobu2007-11-301-2/+3
| | | | git-svn-id: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/ruby/trunk@13860 b2dd03c8-39d4-4d8f-98ff-823fe69b080e