remove prints in parser
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user