Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Moved IR handling to its usage

  • Loading branch information...
commit 64f78b94ac5d158c1da90f8d5c840e152597065b 1 parent ff4231c
@komax authored
Showing with 10 additions and 11 deletions.
  1. +10 −11 bin/ast
View
21 bin/ast
@@ -98,17 +98,6 @@ def indent(string)
string.gsub(/,\s*$/, '').squeeze("\n")
end
-
-def print_passes_on(scope, passes)
- if !scope.kind_of? org.jruby.ir.IRClosure
- passes.each { |pass| pass.run(scope) }
- end
-
- scope.lexical_scopes.each do |child_scope|
- print_passes_on(child_scope, passes)
- end
-end
-
if options[:print_source]
puts "Source:"
puts options[:expression]
@@ -174,6 +163,16 @@ if options[:print_ast]
end
end
+def print_passes_on(scope, passes)
+ if !scope.kind_of? org.jruby.ir.IRClosure
+ passes.each { |pass| pass.run(scope) }
+ end
+
+ scope.lexical_scopes.each do |child_scope|
+ print_passes_on(child_scope, passes)
+ end
+end
+
if options[:print_ir]
runtime = JRuby::runtime
manager = runtime.ir_manager
Please sign in to comment.
Something went wrong with that request. Please try again.