nobu
72ad8595f2
* parse.y (bv_decls, bvar): fix for block variables.
...
[ruby-dev:39423]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25209 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-03 13:14:19 +00:00
nobu
b3525ae1e7
* parse.y (assignable_gen): parser_yyerror takes two arguments.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25201 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-02 19:34:28 +00:00
nobu
a0f667c33e
* parse.y (assignable_gen): get rid of macro collision.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25198 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-02 17:59:25 +00:00
nobu
aec8a4b0a4
* parse.y (ripper_yylval_id, ripper_get_{id,value}): wrap ID by
...
NODE to track local variable assignment.
* parse.y (lvar_defined_gen, assignable_gen): enable local
variable check. [ruby-core:24923]
* parse.y (validate): use value only.
* test/ripper/test_parser_events.rb (test_local_variables): tests
based on a patch from Magnus Holm in [ruby-core:25885].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25187 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-02 11:37:44 +00:00
usa
438b28d3f7
* parse.y (parser_tokadd_string): the byte after ``\'' may be a part of
...
multibyte character, so pushback it. [ruby-list:46416]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-28 02:40:30 +00:00
nobu
bda0b012a8
* parse.y (assign_in_cond): also should warn assignment to dvar in
...
conditional. [ruby-dev:39363]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-23 08:08:32 +00:00
nobu
8686840960
* compile.c (iseq_compile_each), parse.y (stmt, arg): arg_concat()
...
on op_asgn was inversed. [ruby-core:25629] [Bug #2050 ]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24999 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-18 07:15:06 +00:00
nobu
4f041dafbe
* debug.c, parse.y: fixed types.
...
* node.h (nd_line): limit to int.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24924 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-14 07:39:16 +00:00
naruse
e13ca98198
* parse.y (rb_char_to_option_kcode): ASCII-8BIT should also delay.
...
* re.c (parser_regx_options): return rb_ascii8bit_encindex on
ASCII-8BIT. [ruby-dev:39300]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24832 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-10 17:07:38 +00:00
naruse
ba6e61d6f5
Only 1 kcode effects options [ruby-core:25411]
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24819 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-09 08:19:06 +00:00
nobu
b46cd0e400
* include/ruby/ruby.h (rb_data_type_struct): constified dsize.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24801 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-09 02:11:35 +00:00
nobu
fb03cb8275
* parse.y (literal_concat_gen): concat body from dstr instead of
...
nd_next. [ruby-core:25284]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-03 08:57:28 +00:00
nobu
9691894b86
* parse.y (fname): removed duplication.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24739 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-03 08:47:11 +00:00
naruse
6ab36c6e19
*regparse.c (CC_DUP_WARN): use rb_compile_warn if ScanEnv has source
...
information. [ruby-dev:39105]
*re.c (rb_reg_compile): add sourcefile and sourceline to the arguments.
*re.c (make_regexp): ditto.
*re.c (rb_reg_initialize): ditto.
*re.c (rb_reg_initialize_str): ditto.
*re.c (rb_reg_compile): ditto.
*regcomp.c (onig_compile): ditto.
*regint.h (onig_compile): ditto.
*re.c (reg_compile_gen): follow above.
*re.c (rb_reg_to_s): ditto.
*re.c (make_regexp): ditto.
*re.c (rb_reg_initialize): ditto.
*re.c (rb_reg_initialize_str): ditto.
*re.c (rb_reg_new_str): ditto.
*re.c (rb_enc_reg_new): ditto.
*re.c (rb_reg_initialize_m): ditto.
*re.c (rb_reg_init_copy): ditto.
*regcomp.c (onig_new): ditto.
*regcomp.c (onig_compile): set sourcefile and sourceline to scan_env.
*regparse.h (ScanEnv): add sourcefile and sourceline.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-30 08:00:31 +00:00
nobu
4119b54854
* parse.y (rb_enc_symname2_p): not depend on nul terminator.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24714 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-30 07:39:10 +00:00
mame
4c5d7d53b2
* parse.y (reduce_nodes_gen): preserve NODE_FL_NEWLINE flag during
...
node reducing. [ruby-core:24463]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24595 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-20 14:42:16 +00:00
nobu
bfc94fde25
* parse.y (ENABLE_SELECTOR_NAMESPACE): defaulted to 0.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-20 03:11:01 +00:00
nobu
4a7cf7638c
* parse.y (ivar2_hash_type): disabled for now.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24592 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-20 03:09:08 +00:00
nobu
b5e6b46e90
* parse.y (lex_get_str, lex_io_gets, rb_parser_compile_string):
...
must be ascii compatible.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24569 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-17 05:35:10 +00:00
nobu
114f01bd9d
* parse.y (yylex): should dispatch scan-event even when follows
...
just after delayed-token. [ruby-dev:37855] [Bug #1071 ]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24557 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-16 14:58:27 +00:00
nobu
f93bdaed62
* parse.y (fname, string_dvar, sym, dsym, f_arglist): removed
...
duplications.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24542 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-15 01:40:10 +00:00
nobu
6a26b59600
* parse.y (literal_concat0): tail can be nil. [ruby-dev:38980]
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-02 12:04:43 +00:00
nobu
5004e33f8d
* parse.y (literal_concat_gen): reduced unnecessary node at string
...
literal concatenation with empty head dstr. [ruby-dev:38968]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24333 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-31 01:54:14 +00:00
mame
3129ed327e
* parse.y (literal_concat_gen): NODE_DSTR was incorrectly handled as
...
NODE_STR. [ruby-dev:38968]
* bootstraptest/test_syntax.rb: add a test for above.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24332 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-30 18:02:37 +00:00
naruse
3ca25b5a29
* parse.y (regexp): regexp literal at the top of dstr is still needed even if it is empty.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24311 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-28 23:11:29 +00:00
mame
31c561f66a
* vm_core.h (struct rb_iseq_t): add a new field line_no. This field
...
represents line number from which the original code of the iseq
starts. [ruby-dev:38698]
* iseq.c, compile.c: ditto.
* parse.y: line number hack (for Proc#source_location) is no longer
needed.
* test/ruby/test_settracefunc.rb: line number of set_trace_func is now
compatible with 1.8's.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-22 13:37:26 +00:00
nobu
5a392c71db
* compile.c (compile_dstr_fragments): reduced needless literal.
...
* parse.y (xstring, regexp, dsym, literal_concat, evstr2dstr):
literal at the top of dstr is no longer needed if it is empty,
since concatstrings and toregexp always create new strings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-20 10:01:05 +00:00
nobu
415d5ebc2f
* id.c (Init_id), vm.c (vm_exec): @#__ThrowState__ is no longer
...
used. [ruby-dev:38760]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-16 09:28:12 +00:00
nobu
b16c326d5e
* parse.y (parser_data_type): typed.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24011 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-09 22:22:33 +00:00
nobu
fc5f0cafa1
* parse.y (parser_yylex): fixed wrong variable.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23932 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-01 22:53:51 +00:00
nobu
37138a2a93
* parse.y (parser_set_encode): show the erred file name instead of
...
the file that requires it. [ruby-core:24006]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23837 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-24 06:02:33 +00:00
takano32
bc4c51ecce
Tue Jun 16 16:09:59 2009 TAKANO Mitsuhiro (takano32) <tak@no32.tk>
...
* parse.y (parser_read_escape, parser_tokadd_escape):
replace scan_oct as ruby_scan_oct.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23702 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-16 07:14:48 +00:00
nobu
51bf0388aa
* parse.y (struct parser_params): lex_gets_ptr should be long.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-27 14:00:40 +00:00
nobu
064057166b
* parse.y (parser_yyerror): get rid of possible overflow.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23572 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-26 00:22:20 +00:00
nobu
f91b0dc811
* compile.c (rb_parse_in_eval): returns true in true eval, not in
...
main. [ruby-dev:38382]
* parse.y (program): inherits dvars in eval or main.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23474 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-17 05:23:10 +00:00
nobu
f29235378d
* parse.y (magic_comment_encoding): ignores unused emacs-style
...
encoding comment, as like Vim styles. [ruby-core:23470]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-16 00:49:10 +00:00
nobu
78e376a3ee
* defs/keywords (reserved_word): made inline function static.
...
[ruby-core:23210]
* parse.y (rb_reserved_word): ordinary function for ripper.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23436 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-16 00:30:16 +00:00
nobu
d2c07ecb88
* parse.y (magic_comment_encoding): use rb_compile_warning() to
...
show the currently parsing file name. [ruby-core:23469]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23435 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-16 00:19:18 +00:00
matz
ab2119fc3d
* parse.y: add semicolons to some grammar rules not terminated
...
with them. a patch from Dave B in [ruby-core:23422].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23393 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-11 13:54:59 +00:00
nobu
22cde7b682
* dir.c, dln.c, parse.y, re.c, ruby.c, sprintf.c, strftime.c,
...
string.c, util.c, variable.c: use strlcpy, memcpy and snprintf
instead of strcpy, strncpy and sprintf.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-17 01:29:17 +00:00
nobu
4de12b6ae9
* util.c (ruby_scan_oct, ruby_scan_hex): use size_t.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-14 09:25:20 +00:00
nobu
315ee838bc
* parse.y (stack_type): uses VALUE which is able to be stored
...
parser stack.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22887 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-11 04:27:11 +00:00
nobu
12d2c8ba41
stripped trailing spaces.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-22 14:23:33 +00:00
nobu
3b817f834a
* parse.y (debug_lines): calls rb_intern() once.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21712 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-21 05:32:08 +00:00
nobu
8b392f4d4c
* parse.y (rb_parse_in_main): fixed typo.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21588 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-16 02:47:58 +00:00
ko1
e40928733d
* ruby.c (process_options): decrement parse_in_eval to recognize
...
parsing main or normal eval script.
* compile.c (rb_parse_in_main): return 1 if parsing main script.
(if parse_in_eval is negative value, it means main script)
* parse.y (yycompile0): check rb_parse_in_main() to accumulate
script text. Bug #848 [ruby-core:20450]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21571 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-15 16:14:43 +00:00
matz
2a0b6280bb
* parse.y (command): moved return/break/next from command_call for
...
better error message.
* parse.y (call_args): void value check added.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21527 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-15 06:06:47 +00:00
matz
1fc5fb2b7b
* parse.y (stmt): explicit error for "Object::Far += foo 1" just
...
as "Object::Far += 1".
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21520 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-15 05:23:51 +00:00
ko1
597220ef0c
* vm.c (Init_VM): create and define TOPLEVEL_BINDING at first.
...
* vm.c (vm_set_main_stack, rb_iseq_eval_main): added.
* parse.y (rb_parser_compile_file): fix to check parse_in_eval flag.
* eval.c (ruby_exec_node): use rb_iseq_eval_main()
instead of rb_iseq_eval().
* iseq.c (rb_iseq_new_main), vm_core.h: added.
main script (specified by -e or script name) should be run
under TOPLEVEL_BINDING using Kernel#eval. Above changes
simulate Kernel#eval behaviour. [ruby-dev:37240]
* compile.c (make_name_for_block): skip iseq except block type.
this fix is needed for [ruby-dev:37240], and also fixes
[ruby-dev:35392].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21079 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-27 01:15:56 +00:00
matz
5e62997245
* string.c (rb_external_str_new_with_enc): set ASCII-8BIT if
...
encoding is US-ASCII and string contains 8bit characters.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20952 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-23 15:13:18 +00:00