Skip to content

Commit

Permalink
- Fixed line numbers for certain call/iter edge cases
Browse files Browse the repository at this point in the history
[git-p4: depot-paths = "//src/ruby_parser/dev/": change = 6568]
  • Loading branch information
zenspider committed Aug 22, 2011
1 parent a52bc4f commit c42c08b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/ruby_parser.y
Expand Up @@ -987,7 +987,7 @@ rule
call = new_call(nil, oper.to_sym)
iter.insert 1, call
result = iter
call.line ||= iter.line
call.line = iter.line
}
| method_call
| method_call brace_block
Expand Down Expand Up @@ -1203,6 +1203,7 @@ rule
do_block: kDO_BLOCK
{
self.env.extend :dynamic
result = self.lexer.lineno
}
opt_block_var
{
Expand All @@ -1213,6 +1214,7 @@ rule
vars = val[2]
body = val[4]
result = new_iter nil, vars, body
result.line = val[1]

self.env.unextend
}
Expand Down

0 comments on commit c42c08b

Please sign in to comment.