summaryrefslogtreecommitdiffstats
path: root/parse.y
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-06-10 16:09:12 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-06-10 16:09:12 +0000
commitf9b1d4b174128bd92d35fe4b5b2556b57f799bfe (patch)
tree5b8bcc55cfadcc1a915199ad5f1601eee0f3e2f9 /parse.y
parent9cb7e8d4a8269a2992232f535ab9e3561d7ecbe9 (diff)
downloadruby-f9b1d4b174128bd92d35fe4b5b2556b57f799bfe.tar.gz
ruby-f9b1d4b174128bd92d35fe4b5b2556b57f799bfe.tar.xz
ruby-f9b1d4b174128bd92d35fe4b5b2556b57f799bfe.zip
* ext/bigdecimal/lib/bigdecimal/newton.rb (Newton::nlsolve): typo
fixed: raize -> raise. [ruby-talk:196608] * string.c (rb_str_ord): new method. * parse.y (rbracket): allow optional newline before closing brackets. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@10242 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y14
1 files changed, 8 insertions, 6 deletions
diff --git a/parse.y b/parse.y
index a5bb44da6..1eb11da13 100644
--- a/parse.y
+++ b/parse.y
@@ -620,7 +620,6 @@ program : {
/*%
lex_state = EXPR_BEG;
class_nest = !parser->toplevel_p;
- $$ = Qnil;
%*/
}
compstmt
@@ -915,7 +914,7 @@ stmt : kALIAS fitem {lex_state = EXPR_FNAME;} fitem
$$ = dispatch3(opassign, $1, $2, $3);
%*/
}
- | primary_value '[' opt_call_args ']' tOP_ASGN command_call
+ | primary_value '[' opt_call_args rbracket tOP_ASGN command_call
{
/*%%%*/
NODE *args = $3;
@@ -1384,7 +1383,7 @@ mlhs_node : variable
$$ = $1;
%*/
}
- | primary_value '[' opt_call_args ']'
+ | primary_value '[' opt_call_args rbracket
{
/*%%%*/
$$ = aryset($1, $3);
@@ -1458,7 +1457,7 @@ lhs : variable
$$ = dispatch1(var_field, $1);
%*/
}
- | primary_value '[' opt_call_args ']'
+ | primary_value '[' opt_call_args rbracket
{
/*%%%*/
$$ = aryset($1, $3);
@@ -1704,7 +1703,7 @@ arg : lhs '=' arg
$$ = dispatch3(opassign, $1, $2, $3);
%*/
}
- | primary_value '[' opt_call_args ']' tOP_ASGN arg
+ | primary_value '[' opt_call_args rbracket tOP_ASGN arg
{
/*%%%*/
NODE *args;
@@ -3303,7 +3302,7 @@ method_call : operation paren_args
$$ = method_optarg($$, $4);
%*/
}
- | primary_value '[' opt_call_args ']'
+ | primary_value '[' opt_call_args rbracket
{
/*%%%*/
if ($1 && nd_type($1) == NODE_SELF)
@@ -4331,6 +4330,9 @@ opt_nl : /* none */
rparen : opt_nl ')'
;
+rbracket : opt_nl ']'
+ ;
+
trailer : /* none */
| '\n'
| ','