make all instances attr read writers

unfortunately the writers have to have self.var =
otherwise it is just a local var
Also need to make the type explicit for all
Protocol included memory_length on the class for now
This commit is contained in:
Torsten Ruger
2018-08-11 19:15:34 +03:00
parent e6df473647
commit b0aefe31fe
19 changed files with 243 additions and 216 deletions

View File

@ -12,10 +12,13 @@ module Parfait
#
class VoolMethod < Object
attr_reader :name , :args_type , :frame_type , :source
attr :type, :name , :args_type , :frame_type , :source
def initialize(name , args_type , frame_type , source )
@name , @args_type , @frame_type , @source = name , args_type, frame_type , source
self.name = name
self.args_type = args_type
self.frame_type = frame_type
self.source = source
raise "Name must be symbol" unless name.is_a?(Symbol)
raise "args_type must be type" unless args_type.is_a?(Parfait::Type)
raise "frame_type must be type" unless frame_type.is_a?(Parfait::Type)
@ -25,7 +28,7 @@ module Parfait
def create_callable_method( type )
raise "create_method #{type.inspect} is not a Type" unless type.is_a? Parfait::Type
type.create_method( @name , @args_type , @frame_type)
type.create_method( name , args_type , frame_type)
end
def compiler_for(self_type)