Skip to content
Browse files

Handle :do in a method call properly

Repro code:

after_transition :do => :update_chcecked_at
  • Loading branch information...
1 parent 214e23b commit 5b99467b79a080362c15652974fef628caf51851 Evan Phoenix committed May 10, 2010
Showing with 7 additions and 1 deletion.
  1. +1 −1 kernel/loader.rb
  2. +3 −0 lib/ext/melbourne/grammar.cpp
  3. +3 −0 lib/ext/melbourne/grammar.y
View
2 kernel/loader.rb
@@ -151,7 +151,7 @@ def options(argv=ARGV)
end
options.on "-c", "FILE", "Check the syntax of FILE" do |file|
- mel = Rubinius::Melbourne.new file, 0, []
+ mel = Rubinius::Melbourne.new file, 1, []
begin
mel.parse_file
rescue SyntaxError => e
View
3 lib/ext/melbourne/grammar.cpp
@@ -9908,6 +9908,9 @@ yylex(void *yylval_v, void *vstate)
parse_state->lex_state = kw->state;
if (state == EXPR_FNAME) {
pslval->id = rb_parser_sym(kw->name);
+ // Hack. Ignore the different variants of do
+ // if we're just trying to match a FNAME
+ if(kw->id[0] == kDO) return kDO;
}
if (kw->id[0] == kDO) {
if (COND_P()) return kDO_COND;
View
3 lib/ext/melbourne/grammar.y
@@ -4717,6 +4717,9 @@ yylex(void *yylval_v, void *vstate)
parse_state->lex_state = kw->state;
if (state == EXPR_FNAME) {
pslval->id = rb_parser_sym(kw->name);
+ // Hack. Ignore the different variants of do
+ // if we're just trying to match a FNAME
+ if(kw->id[0] == kDO) return kDO;
}
if (kw->id[0] == kDO) {
if (COND_P()) return kDO_COND;

0 comments on commit 5b99467

Please sign in to comment.
Something went wrong with that request. Please try again.