summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-06-07 08:22:42 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-06-07 08:22:42 +0000
commit549c345cefe03ab3f35b9cca1192a0062f288eca (patch)
treeebec2258661db268552635e00841de994b1918a0 /parse.y
parent7eef190796511c58756e58d4e3666f3a78523f5c (diff)
* parse.y (parser_yylex): allow ';;' to be block terminator in
place of 'end'. [highly experimental] * misc/ruby-mode.el (ruby-block-end-re): allow ';;' for a negative indent trigger. [highly experimental] * parse.y (parser_yylex): "respond_to?:foo" should be interpreted as "respond_to? :foo" at the command level. [ruby-talk:144303] * sprintf.c (rb_f_sprintf): raise exception on debug mode (-d), not verbose mode (-w/-w). [ruby-core:05123] * sprintf.c (rb_f_sprintf): warn always on verbose mode. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8579 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y7
1 files changed, 6 insertions, 1 deletions
diff --git a/parse.y b/parse.y
index b5e040944d..0037f603d4 100644
--- a/parse.y
+++ b/parse.y
@@ -6304,6 +6304,11 @@ parser_yylex(parser)
return '^';
case ';':
+ if ((c = nextc()) == ';') {
+ lex_state = EXPR_END;
+ return kEND;
+ }
+ pushback(c);
command_start = Qtrue;
case ',':
lex_state = EXPR_BEG;
@@ -6700,7 +6705,7 @@ parser_yylex(parser)
}
}
- if (lex_state == EXPR_BEG ||
+ if ((lex_state == EXPR_BEG && !cmd_state) ||
lex_state == EXPR_ARG ||
lex_state == EXPR_CMDARG) {
if (peek(':') && !(lex_p + 1 < lex_pend && lex_p[1] == ':')) {