Skip to content

Commit

Permalink
If expressions should return $last, not nil. Fixes #4.
Browse files Browse the repository at this point in the history
  • Loading branch information
headius committed Dec 26, 2012
1 parent 8122f95 commit c8f8c17
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/ruby/fast_ruby/expression_compiler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ def nil_expression(*args)
def empty_expression
nil
end

def last_expression
ast.new_name('$last')
end

def visitAndNode(node)
and_expr = ast.new_infix_expression
Expand Down Expand Up @@ -192,7 +196,7 @@ def visitIfNode(node)

body_compiler.body.statements << conditional

nil_expression
last_expression
end

def visitLocalAsgnNode(node)
Expand Down

0 comments on commit c8f8c17

Please sign in to comment.