mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
parse.y: Remove unneeded type decls for Ripper
I think that they are not used. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61964 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
2a628a4346
commit
a64054cd34
3 changed files with 3 additions and 18 deletions
|
@ -8,6 +8,7 @@ class DSL
|
||||||
@events = {}
|
@events = {}
|
||||||
@error = options.include?("error")
|
@error = options.include?("error")
|
||||||
@brace = options.include?("brace")
|
@brace = options.include?("brace")
|
||||||
|
@final = options.include?("final")
|
||||||
|
|
||||||
# create $1 == "$1", $2 == "$2", ...
|
# create $1 == "$1", $2 == "$2", ...
|
||||||
re, s = "", ""
|
re, s = "", ""
|
||||||
|
@ -28,6 +29,7 @@ class DSL
|
||||||
|
|
||||||
def generate
|
def generate
|
||||||
s = "$$"
|
s = "$$"
|
||||||
|
s = "p->result" if @final
|
||||||
s = "\t\t\t#{ s } = #@code;"
|
s = "\t\t\t#{ s } = #@code;"
|
||||||
s << "ripper_error(p);" if @error
|
s << "ripper_error(p);" if @error
|
||||||
s = "{#{ s }}" if @brace
|
s = "{#{ s }}" if @brace
|
||||||
|
|
|
@ -43,12 +43,6 @@ def prelude(f, out)
|
||||||
@exprs = {}
|
@exprs = {}
|
||||||
while line = f.gets
|
while line = f.gets
|
||||||
case line
|
case line
|
||||||
when %r</\*%%%\*/>
|
|
||||||
out << '/*' << $/
|
|
||||||
when %r</\*%>
|
|
||||||
out << '*/' << $/
|
|
||||||
when %r<%\*/>
|
|
||||||
out << $/
|
|
||||||
when /\A%%/
|
when /\A%%/
|
||||||
out << '%%' << $/
|
out << '%%' << $/
|
||||||
return
|
return
|
||||||
|
|
13
parse.y
13
parse.y
|
@ -874,10 +874,6 @@ static void token_info_pop(struct parser_params*, const char *token, const rb_co
|
||||||
%type <id> fsym keyword_variable user_variable sym symbol operation operation2 operation3
|
%type <id> fsym keyword_variable user_variable sym symbol operation operation2 operation3
|
||||||
%type <id> cname fname op f_rest_arg f_block_arg opt_f_block_arg f_norm_arg f_bad_arg
|
%type <id> cname fname op f_rest_arg f_block_arg opt_f_block_arg f_norm_arg f_bad_arg
|
||||||
%type <id> f_kwrest f_label f_arg_asgn call_op call_op2 reswords relop
|
%type <id> f_kwrest f_label f_arg_asgn call_op call_op2 reswords relop
|
||||||
/*%%%*/
|
|
||||||
/*%
|
|
||||||
%type <val> program then do
|
|
||||||
%*/
|
|
||||||
%token END_OF_INPUT 0 "end-of-input"
|
%token END_OF_INPUT 0 "end-of-input"
|
||||||
%token tUPLUS RUBY_TOKEN(UPLUS) "unary+"
|
%token tUPLUS RUBY_TOKEN(UPLUS) "unary+"
|
||||||
%token tUMINUS RUBY_TOKEN(UMINUS) "unary-"
|
%token tUMINUS RUBY_TOKEN(UMINUS) "unary-"
|
||||||
|
@ -968,11 +964,7 @@ program : {
|
||||||
}
|
}
|
||||||
p->eval_tree = NEW_SCOPE(0, block_append(p, p->eval_tree, $2), &@$);
|
p->eval_tree = NEW_SCOPE(0, block_append(p, p->eval_tree, $2), &@$);
|
||||||
/*% %*/
|
/*% %*/
|
||||||
/*% ripper: program!($2) %*/
|
/*% ripper[final]: program!($2) %*/
|
||||||
/*%%%*/
|
|
||||||
/*%
|
|
||||||
p->result = $$;
|
|
||||||
%*/
|
|
||||||
local_pop(p);
|
local_pop(p);
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
@ -2686,14 +2678,11 @@ k_return : keyword_return
|
||||||
;
|
;
|
||||||
|
|
||||||
then : term
|
then : term
|
||||||
/*% ripper[brace]: "Qnil" %*/
|
|
||||||
| keyword_then
|
| keyword_then
|
||||||
| term keyword_then
|
| term keyword_then
|
||||||
/*% ripper[brace]: $2 %*/
|
|
||||||
;
|
;
|
||||||
|
|
||||||
do : term
|
do : term
|
||||||
/*% ripper[brace]: "Qnil" %*/
|
|
||||||
| keyword_do_cond
|
| keyword_do_cond
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue