summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-03-07 21:30:37 +0000
committeraamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-03-07 21:30:37 +0000
commite469bcd0784a005c3760be56d25171f8e7a073bc (patch)
tree374907f48b8dc2be76ea7f5a640aa8baf0ab6297
parent10860cf3f31d0e5689c4211c1edce49af0223cb3 (diff)
downloadruby-half-baked-1.9.tar.gz
* parse.y (opt_bv_decl): resolve type crash by declarating type of bv_decls, opt_bv_decl, bvar.half-baked-1.9
* parse.y: remove undefined function prototypes. * parse.y: remove unused variable declaration. * ext/ripper/extconf.rb: do not stop to compile ripper. * parse.y (opt_bv_decl): provide actions for bv_decls, opt_bv_decl, bvar, f_arg. * parse.y (ripper): disable unused functions in ripper. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/half-baked-1.9@12009 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog16
-rw-r--r--ext/ripper/extconf.rb2
-rw-r--r--parse.y41
3 files changed, 49 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index 3be26e5fd9..a63acb9a02 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+Thu Mar 8 06:30:27 2007 Minero Aoki <aamine@loveruby.net>
+
+ * parse.y (opt_bv_decl): resolve type crash by declarating type of
+ bv_decls, opt_bv_decl, bvar.
+
+ * parse.y: remove undefined function prototypes.
+
+ * parse.y: remove unused variable declaration.
+
+ * ext/ripper/extconf.rb: do not stop to compile ripper.
+
+ * parse.y (opt_bv_decl): provide actions for bv_decls,
+ opt_bv_decl, bvar, f_arg.
+
+ * parse.y (ripper): disable unused functions in ripper.
+
Fri Mar 2 10:48:33 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (rb_f_local_variables): should skip temporary argument
diff --git a/ext/ripper/extconf.rb b/ext/ripper/extconf.rb
index 0827535ad4..d7369a080c 100644
--- a/ext/ripper/extconf.rb
+++ b/ext/ripper/extconf.rb
@@ -2,8 +2,6 @@
require 'mkmf'
require 'rbconfig'
-exit
-
def main
unless find_executable('bison')
unless File.exist?('ripper.c') or File.exist?("#{$srcdir}/ripper.c")
diff --git a/parse.y b/parse.y
index 49fabd80d3..21b87c82c1 100644
--- a/parse.y
+++ b/parse.y
@@ -124,6 +124,7 @@ struct local_vars {
#define DVARS_SPECIAL_P(tbl) (!POINTER_P(tbl))
#define POINTER_P(val) ((unsigned long)(val) & ~3UL)
+#ifndef RIPPER
static int
vtable_size(struct vtable *tbl)
{
@@ -192,6 +193,7 @@ vtable_included(struct vtable * tbl, ID id)
}
return 0;
}
+#endif
/*
Structure of Lexer Buffer:
@@ -385,8 +387,6 @@ static int local_id_gen(struct parser_params*, ID);
#define local_id(id) local_id_gen(parser, id)
static ID *local_tbl_gen(struct parser_params*);
#define local_tbl() local_tbl_gen(parser)
-static ID *dyna_tbl_gen(struct parser_params*);
-#define dyna_tbl() dyna_tbl_gen(parser)
static ID internal_id(void);
static void dyna_push_gen(struct parser_params*);
@@ -613,6 +613,7 @@ static void ripper_compile_error(struct parser_params*, const char *fmt, ...);
%type <node> f_arglist f_args f_arg f_arg_item f_optarg f_marg f_marg_head f_margs
%type <node> assoc_list assocs assoc undef_list backref string_dvar for_var
%type <node> block_param opt_block_param block_param_def f_opt
+%type <node> bv_decls opt_bv_decl bvar
%type <node> lambda f_larglist lambda_body
%type <node> brace_block cmd_brace_block do_block lhs none fitem
%type <node> mlhs mlhs_head mlhs_basic mlhs_item mlhs_node mlhs_post
@@ -3127,7 +3128,7 @@ block_param_def : '|' opt_bv_decl '|'
/*%%%*/
$$ = $2;
/*%
- $$ = blockvar_new($2);
+ $$ = blockvar_new(escape_Qundef($2));
%*/
}
;
@@ -3135,10 +3136,30 @@ block_param_def : '|' opt_bv_decl '|'
opt_bv_decl : none
| ';' bv_decls
+ {
+ /*%%%*/
+ $$ = 0;
+ /*%
+ $$ = $2;
+ %*/
+ }
;
bv_decls : bvar
+ /*%c%*/
+ /*%c
+ {
+ $$ = mlhs_new();
+ $$ = mlhs_add($$, $1);
+ }
+ %*/
| bv_decls ',' bvar
+ /*%c%*/
+ /*%c
+ {
+ $$ = mlhs_add($$, $3);
+ }
+ %*/
;
bvar : f_norm_arg
@@ -3146,6 +3167,7 @@ bvar : f_norm_arg
/*%%%*/
new_bv($1);
/*%
+ $$ = dispatch0(new_blockvars)
%*/
}
;
@@ -4096,6 +4118,12 @@ f_arg_item : f_norm_arg
;
f_arg : f_arg_item
+ /*%c%*/
+ /*%c
+ {
+ $$ = rb_ary_new3(1, $1);
+ }
+ c%*/
| f_arg ',' f_arg_item
{
/*%%%*/
@@ -4103,10 +4131,7 @@ f_arg : f_arg_item
$$->nd_next = block_append($$->nd_next, $3->nd_next);
rb_gc_force_recycle((VALUE)$3);
/*%
- #if 0
- TODO: Fix me
- #endif
- rb_ary_push($$, $1);
+ rb_ary_push($$, $3);
%*/
}
;
@@ -7940,7 +7965,7 @@ vtable_tblcpy(ID *buf, struct vtable *src)
static ID*
vtable_to_tbl(struct vtable *src)
{
- int i, cnt = vtable_size(src);
+ int cnt = vtable_size(src);
ID *buf;
if (cnt <= 0) return 0;