Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed defined? for more expressions. Fixes #2611.
  • Loading branch information
brixen committed Sep 21, 2013
1 parent 3569122 commit 6d611c7
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/compiler/ast/control_flow.rb
Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 6d611c7

Please sign in to comment.