Browse files

checking for combination of -p and -i and implementation for -p

  • Loading branch information...
1 parent 53d3928 commit c65eed5aad9ed34ffaf01bf596f74a4df41e2663 @komax committed Jul 11, 2013
Showing with 9 additions and 0 deletions.
  1. +9 −0 bin/ast
View
9 bin/ast
@@ -71,6 +71,10 @@ elsif ! options.has_key?(:expression)
abort "No script specified (see --help)"
end
+if options[:print_ir] && options[:print_pass]
+ abort "-p and -i is not valid. Use only one of them (see --help)"
+end
+
$indent_string = " "
def indexes(string, lindex, rindex)
@@ -200,6 +204,11 @@ end
if options[:print_pass]
scope, passes = ir_setup(root)
+ pass_name = options[:print_pass]
+ pass = passes.find do |p|
+ p.java_class.to_s.include?(pass_name.to_s)
+ end
+ print_pass_on(scope, pass)
end
if options[:print_ir]

0 comments on commit c65eed5

Please sign in to comment.