Permalink
Browse files

CaseClauseNode goes away, because I'm being evil instead.

  • Loading branch information...
1 parent 95d7c7f commit d3b17195e739dcf67722c67d0b8c31162b4e4253 @matthewd committed Dec 10, 2010
Showing with 6 additions and 4 deletions.
  1. +6 −4 lib/capuchin/visitor.rb
@@ -397,6 +397,11 @@ def visit_DeleteNode(o)
end
def visit_SwitchNode(o)
+ # We cheat here, and reach down into our case nodes, because we loop
+ # through them twice: once to build the sequence of compare+gotos,
+ # then again to output the actual code blocks.
+
+ pos(o)
lbl = @g.state.scope.current_line_label
done = @g.new_label
@@ -440,17 +445,14 @@ def visit_SwitchNode(o)
end
done.set!
end
- def visit_CaseClauseNode(o)
- # o.left (nil == default), o.value
- raise NotImplementedError, "case"
- end
def visit_WithNode(o)
# o.left, o.value
raise NotImplementedError, "with"
end
def visit_LabelNode(o)
+ pos(o)
@g.state.scope.with_line_label(o.name.to_sym) do
accept o.value
end

0 comments on commit d3b1719

Please sign in to comment.