зеркало из https://github.com/github/ruby.git
* parse.y (stmt, mlhs_node, lhs, arg, method_call): aref_args might be
nothing. fixed: [ruby-dev:26952] * ext/ripper/eventids2.c: added new tokens. fixed: [ruby-dev:26952] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9083 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
df27d91fc4
Коммит
768e6c1328
|
@ -1,3 +1,10 @@
|
|||
Mon Sep 5 22:28:46 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* parse.y (stmt, mlhs_node, lhs, arg, method_call): aref_args might be
|
||||
nothing. fixed: [ruby-dev:26952]
|
||||
|
||||
* ext/ripper/eventids2.c: added new tokens. fixed: [ruby-dev:26952]
|
||||
|
||||
Mon Sep 5 17:03:07 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* lib/ostruct.rb: a patch from Florian Gross <florgro@gmail.com>
|
||||
|
|
|
@ -42,6 +42,10 @@ static ID ripper_id_qwords_beg;
|
|||
static ID ripper_id_words_sep;
|
||||
static ID ripper_id_regexp_beg;
|
||||
static ID ripper_id_regexp_end;
|
||||
static ID ripper_id_label;
|
||||
static ID ripper_id_lambda;
|
||||
static ID ripper_id_lambda_arg;
|
||||
static ID ripper_id_lambeg;
|
||||
|
||||
static ID ripper_id_ignored_nl;
|
||||
static ID ripper_id_comment;
|
||||
|
@ -90,6 +94,10 @@ ripper_init_eventids2()
|
|||
ripper_id_words_sep = rb_intern("on_words_sep");
|
||||
ripper_id_regexp_beg = rb_intern("on_regexp_beg");
|
||||
ripper_id_regexp_end = rb_intern("on_regexp_end");
|
||||
ripper_id_label = rb_intern("on_label");
|
||||
ripper_id_lambda = rb_intern("on_lambda");
|
||||
ripper_id_lambda_arg = rb_intern("on_lambda_arg");
|
||||
ripper_id_lambeg = rb_intern("on_lambeg");
|
||||
|
||||
ripper_id_ignored_nl = rb_intern("on_ignored_nl");
|
||||
ripper_id_comment = rb_intern("on_comment");
|
||||
|
@ -234,6 +242,10 @@ static struct token_assoc {
|
|||
{tUPLUS, &ripper_id_op},
|
||||
{tWORDS_BEG, &ripper_id_words_beg},
|
||||
{tXSTRING_BEG, &ripper_id_backtick},
|
||||
{tLABEL, &ripper_id_label},
|
||||
{tLAMBDA, &ripper_id_lambda},
|
||||
{tLAMBDA_ARG, &ripper_id_lambda_arg},
|
||||
{tLAMBEG, &ripper_id_lambeg},
|
||||
|
||||
/* ripper specific tokens */
|
||||
{tIGNORED_NL, &ripper_id_ignored_nl},
|
||||
|
|
|
@ -176,6 +176,10 @@ class Ripper
|
|||
:int => 1,
|
||||
:ivar => 1,
|
||||
:kw => 1,
|
||||
:label => 1,
|
||||
:lambda => 1,
|
||||
:lambda_arg => 1,
|
||||
:lambeg => 1,
|
||||
:lbrace => 1,
|
||||
:lbracket => 1,
|
||||
:lparen => 1,
|
||||
|
@ -816,6 +820,22 @@ class Ripper
|
|||
token
|
||||
end
|
||||
|
||||
def on_label(token)
|
||||
token
|
||||
end
|
||||
|
||||
def on_lambda(token)
|
||||
token
|
||||
end
|
||||
|
||||
def on_lambda_arg(token)
|
||||
token
|
||||
end
|
||||
|
||||
def on_lambeg(token)
|
||||
token
|
||||
end
|
||||
|
||||
def on_lbrace(token)
|
||||
token
|
||||
end
|
||||
|
|
10
parse.y
10
parse.y
|
@ -921,7 +921,7 @@ stmt : kALIAS fitem {lex_state = EXPR_FNAME;} fitem
|
|||
$$ = NEW_OP_ASGN1($1, $5, args);
|
||||
fixpos($$, $1);
|
||||
/*%
|
||||
$$ = dispatch2(aref_field, $1, $3);
|
||||
$$ = dispatch2(aref_field, $1, escape_Qundef($3));
|
||||
$$ = dispatch3(opassign, $$, $5, $6);
|
||||
%*/
|
||||
}
|
||||
|
@ -1341,7 +1341,7 @@ mlhs_node : variable
|
|||
/*%%%*/
|
||||
$$ = aryset($1, $3);
|
||||
/*%
|
||||
$$ = dispatch2(aref_field, $1, $3);
|
||||
$$ = dispatch2(aref_field, $1, escape_Qundef($3));
|
||||
%*/
|
||||
}
|
||||
| primary_value '.' tIDENTIFIER
|
||||
|
@ -1415,7 +1415,7 @@ lhs : variable
|
|||
/*%%%*/
|
||||
$$ = aryset($1, $3);
|
||||
/*%
|
||||
$$ = dispatch2(aref_field, $1, $3);
|
||||
$$ = dispatch2(aref_field, $1, escape_Qundef($3));
|
||||
%*/
|
||||
}
|
||||
| primary_value '.' tIDENTIFIER
|
||||
|
@ -1676,7 +1676,7 @@ arg : lhs '=' arg
|
|||
$$ = NEW_OP_ASGN1($1, $5, args);
|
||||
fixpos($$, $1);
|
||||
/*%
|
||||
$1 = dispatch2(aref_field, $1, $3);
|
||||
$1 = dispatch2(aref_field, $1, escape_Qundef($3));
|
||||
$$ = dispatch3(opassign, $1, $5, $6);
|
||||
%*/
|
||||
}
|
||||
|
@ -3364,7 +3364,7 @@ method_call : operation paren_args
|
|||
$$ = NEW_CALL($1, tAREF, $3);
|
||||
fixpos($$, $1);
|
||||
/*%
|
||||
$$ = dispatch2(aref, $1, $3);
|
||||
$$ = dispatch2(aref, $1, escape_Qundef($3));
|
||||
%*/
|
||||
}
|
||||
;
|
||||
|
|
Загрузка…
Ссылка в новой задаче