Skip to content
Permalink
Browse files
Fixed defined? for more expressions. Fixes #2611.
  • Loading branch information
brixen committed Sep 21, 2013
1 parent 3569122 commit 6d611c7a2fbc5b8b73f1fe37752688d37015bc09
Showing with 12 additions and 0 deletions.
  1. +12 −0 lib/compiler/ast/control_flow.rb
@@ -32,6 +32,10 @@ def receiver_sexp
nil
end

def defined(g)
g.push_literal "expression"
end

def to_sexp
else_sexp = @else.kind_of?(NilLiteral) ? nil : @else.to_sexp
sexp = [:case, receiver_sexp]
@@ -328,6 +332,10 @@ def bytecode(g)
done.set!
end

def defined(g)
g.push_literal "expression"
end

def to_sexp
else_sexp = @else.kind_of?(NilLiteral) ? nil : @else.to_sexp
[:if, @condition.to_sexp, @body.to_sexp, else_sexp]
@@ -405,6 +413,10 @@ def bytecode(g, use_gif=true)
g.pop_modifiers
end

def defined(g)
g.push_literal "expression"
end

def sexp_name
:while
end

0 comments on commit 6d611c7

Please sign in to comment.