diff --git a/lib/ruby_algebra/parser.rb b/lib/ruby_algebra/parser.rb index 05c8086..77e4b8b 100644 --- a/lib/ruby_algebra/parser.rb +++ b/lib/ruby_algebra/parser.rb @@ -116,7 +116,6 @@ module RubyAlgebra elsif c == " " i += 1 else - puts "Unrecognized character at pos #{i}" i += 1 end end @@ -127,7 +126,6 @@ module RubyAlgebra operators = [] out_stack = [] tokenize(expr) do |token| - pp token if token.type == :num out_stack.push(Constant.new(token.value)) elsif token.type == :end @@ -166,9 +164,6 @@ module RubyAlgebra b = out_stack.pop if oper.type == :op a = out_stack.pop - puts "make unary op #{oper.op} from (#{a})" if oper.type == :unary_op - puts "make binary op #{oper.op} from (#{a}), (#{b})" if oper.type == :op - case oper.op when :add out_stack.push Addition.new(a, b)