generalise the operator handling

ie passing them through
implementing more
This commit is contained in:
Torsten Ruger
2018-04-19 22:13:52 +03:00
parent 7d9132ee36
commit 9e21719aeb
6 changed files with 24 additions and 29 deletions

View File

@ -181,7 +181,10 @@ module Risc
end
obj = space.get_class_by_name(:Integer)
[ :putint, :div4, :div10, :+ , :- , :*].each do |f| #div4 is just a forward declaration
Risc.operators.each do |op|
obj.instance_type.add_method Builtin::Integer.operator_method(op)
end
[:putint, :div4, :div10].each do |f| #div4 is just a forward declaration
obj.instance_type.add_method Builtin::Integer.send(f , nil)
end
end