adding Tue False and Nil Class to Parfait
and boot
This commit is contained in:
parent
d195ef68da
commit
99ced4369a
@ -15,7 +15,7 @@ module Arm
|
|||||||
class ArmMachine
|
class ArmMachine
|
||||||
|
|
||||||
# conditions specify all the possibilities for branches. Branches are b + condition
|
# conditions specify all the possibilities for branches. Branches are b + condition
|
||||||
# Example: beq means brach if equal.
|
# Example: beq means branch if equal.
|
||||||
# :al means always, so bal is an unconditional branch (but b() also works)
|
# :al means always, so bal is an unconditional branch (but b() also works)
|
||||||
CONDITIONS = [:al ,:eq ,:ne ,:lt ,:le ,:ge,:gt ,:cs ,:mi ,:hi ,:cc ,:pl,:ls ,:vc ,:vs]
|
CONDITIONS = [:al ,:eq ,:ne ,:lt ,:le ,:ge,:gt ,:cs ,:mi ,:hi ,:cc ,:pl,:ls ,:vc ,:vs]
|
||||||
|
|
||||||
|
@ -25,17 +25,17 @@ module Mom
|
|||||||
end
|
end
|
||||||
class TrueConstant < Constant
|
class TrueConstant < Constant
|
||||||
def ct_type
|
def ct_type
|
||||||
Parfait.object_space.get_class_by_name(:True).instance_type
|
Parfait.object_space.get_class_by_name(:TrueClass).instance_type
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
class FalseConstant < Constant
|
class FalseConstant < Constant
|
||||||
def ct_type
|
def ct_type
|
||||||
Parfait.object_space.get_class_by_name(:False).instance_type
|
Parfait.object_space.get_class_by_name(:FalseClass).instance_type
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
class NilConstant < Constant
|
class NilConstant < Constant
|
||||||
def ct_type
|
def ct_type
|
||||||
Parfait.object_space.get_class_by_name(:Nil).instance_type
|
Parfait.object_space.get_class_by_name(:NilClass).instance_type
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
class StringConstant < Constant
|
class StringConstant < Constant
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
# Integer class for representing maths on Integers
|
# Integer class for representing maths on Integers
|
||||||
# Integers are Objects, spcifically DataObjects
|
# Integers are Objects, specifically DataObjects
|
||||||
# - they have fixed value
|
# - they have fixed value
|
||||||
# - they are immutable
|
# - they are immutable
|
||||||
# (both by implementation, not design.
|
# (both by implementation, not design.
|
||||||
@ -21,4 +21,12 @@ module Parfait
|
|||||||
# :quo, :to_c, :real, :imaginary, :imag, :abs2, :arg, :angle, :phase, :rectangular, :rect, :polar, :conjugate, :conj,
|
# :quo, :to_c, :real, :imaginary, :imag, :abs2, :arg, :angle, :phase, :rectangular, :rect, :polar, :conjugate, :conj,
|
||||||
# :>, :>=, :<, :<=, :between?
|
# :>, :>=, :<, :<=, :between?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# adding other base classes in here for now:
|
||||||
|
class FalseClass
|
||||||
|
end
|
||||||
|
class TrusClass
|
||||||
|
end
|
||||||
|
class NilClass
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
@ -129,10 +129,15 @@ module Risc
|
|||||||
:return_address => :Integer, :return_value => :Integer,
|
:return_address => :Integer, :return_value => :Integer,
|
||||||
:caller => :Message , :name => :Word , :arguments => :NamedList },
|
:caller => :Message , :name => :Word , :arguments => :NamedList },
|
||||||
:Integer => {},
|
:Integer => {},
|
||||||
|
:TrueClass => {},
|
||||||
|
:FalseClass => {},
|
||||||
|
:NilClass => {},
|
||||||
:Object => {},
|
:Object => {},
|
||||||
:Kernel => {}, #fix, kernel is a class, but should be a module
|
:Kernel => {}, #fix, kernel is a class, but should be a module
|
||||||
:BinaryCode => {:char_length => :Integer} ,
|
:BinaryCode => {:char_length => :Integer} ,
|
||||||
:Space => {:classes => :Dictionary , :types => :Dictionary , :first_message => :Message},
|
:Space => {:classes => :Dictionary , :types => :Dictionary ,
|
||||||
|
:first_message => :Message , single_true: :TrueClass,
|
||||||
|
single_false: :FalseClass , single_nil: :NilClass},
|
||||||
:NamedList => {},
|
:NamedList => {},
|
||||||
:Type => {:names => :List , :types => :List ,
|
:Type => {:names => :List , :types => :List ,
|
||||||
:object_class => :Class, :methods => :List } ,
|
:object_class => :Class, :methods => :List } ,
|
||||||
|
Loading…
Reference in New Issue
Block a user