Skip to content

Instantly share code, notes, and snippets.

@takeru
Created August 18, 2010 18:01
Show Gist options
  • Select an option

  • Save takeru/535645 to your computer and use it in GitHub Desktop.

Select an option

Save takeru/535645 to your computer and use it in GitHub Desktop.
diff --git a/lib/mirah/ast.rb b/lib/mirah/ast.rb
index 80cac7f..3993669 100644
--- a/lib/mirah/ast.rb
+++ b/lib/mirah/ast.rb
@@ -104,6 +104,7 @@ module Duby
def inspect_children(indent = 0)
indent_str = ' ' * indent
str = ''
+if children
children.each_with_index do |child, i|
extra_indent = 0
if child
@@ -129,6 +130,9 @@ module Duby
end
end
end
+else
+ str << "\n(children is nil)"
+end
str
end
diff --git a/lib/mirah/transform.rb b/lib/mirah/transform.rb
index aa9d077..c289579 100644
--- a/lib/mirah/transform.rb
+++ b/lib/mirah/transform.rb
@@ -803,7 +803,7 @@ module Duby
LocalAssignment.new(block, first_node.position, temp) do |l|
[transformer.transform(first_node, l)]
end,
- If.new(parent, position) do |iff|
+ If.new(block, block.position) do |iff|
[
Condition.new(iff, first_node.position) do |cond|
[Local.new(cond, first_node.position, temp)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment