зеркало из https://github.com/github/ruby.git
* eval.c (rb_eval), parse.y (arg): reduce fixnum range literal at
parser. fixed: [ruby-dev:26113] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8401 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
fa1855c6d4
Коммит
1ec656e349
|
@ -1,8 +1,11 @@
|
|||
Sun May 1 09:13:23 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
Sun May 1 09:15:17 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* ruby.c (process_sflag): replace '-' in variable names with '_'.
|
||||
[ruby-dev:26107]
|
||||
|
||||
* eval.c (rb_eval), parse.y (arg): reduce fixnum range literal at
|
||||
parser. fixed: [ruby-dev:26113]
|
||||
|
||||
Sat Apr 30 11:59:25 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* configure.in (RUBY_FUNC_ATTRIBUTE): check for function attribute.
|
||||
|
|
10
eval.c
10
eval.c
|
@ -3226,16 +3226,6 @@ rb_eval(self, n)
|
|||
result = rb_range_new(rb_eval(self, node->nd_beg),
|
||||
rb_eval(self, node->nd_end),
|
||||
nd_type(node) == NODE_DOT3);
|
||||
if (node->nd_state) break;
|
||||
if (nd_type(node->nd_beg) == NODE_LIT && FIXNUM_P(node->nd_beg->nd_lit) &&
|
||||
nd_type(node->nd_end) == NODE_LIT && FIXNUM_P(node->nd_end->nd_lit))
|
||||
{
|
||||
nd_set_type(node, NODE_LIT);
|
||||
node->nd_lit = result;
|
||||
}
|
||||
else {
|
||||
node->nd_state = 1;
|
||||
}
|
||||
break;
|
||||
|
||||
case NODE_FLIP2: /* like AWK */
|
||||
|
|
18
parse.y
18
parse.y
|
@ -1760,7 +1760,14 @@ arg : lhs '=' arg
|
|||
/*%%%*/
|
||||
value_expr($1);
|
||||
value_expr($3);
|
||||
$$ = NEW_DOT2($1, $3);
|
||||
if (nd_type($1) == NODE_LIT && FIXNUM_P($1->nd_lit) &&
|
||||
nd_type($3) == NODE_LIT && FIXNUM_P($3->nd_lit)) {
|
||||
$1->nd_lit = rb_range_new($1->nd_lit, $3->nd_lit, Qfalse);
|
||||
$$ = $1;
|
||||
}
|
||||
else {
|
||||
$$ = NEW_DOT2($1, $3);
|
||||
}
|
||||
/*%
|
||||
$$ = dispatch2(dot2, $1, $3);
|
||||
%*/
|
||||
|
@ -1770,7 +1777,14 @@ arg : lhs '=' arg
|
|||
/*%%%*/
|
||||
value_expr($1);
|
||||
value_expr($3);
|
||||
$$ = NEW_DOT3($1, $3);
|
||||
if (nd_type($1) == NODE_LIT && FIXNUM_P($1->nd_lit) &&
|
||||
nd_type($3) == NODE_LIT && FIXNUM_P($3->nd_lit)) {
|
||||
$1->nd_lit = rb_range_new($1->nd_lit, $3->nd_lit, Qtrue);
|
||||
$$ = $1;
|
||||
}
|
||||
else {
|
||||
$$ = NEW_DOT3($1, $3);
|
||||
}
|
||||
/*%
|
||||
$$ = dispatch2(dot3, $1, $3);
|
||||
%*/
|
||||
|
|
Загрузка…
Ссылка в новой задаче