move ruby_method out of rubyx
ruby getting ready for destruction as it’s not used anymore
This commit is contained in:
@ -16,7 +16,7 @@ module Rubyx
|
||||
name , args , body = *statement
|
||||
args_type = make_type(args)
|
||||
locals_type = make_locals(body)
|
||||
@methods << RubyMethod.new(name , args_type , locals_type , body )
|
||||
@methods << Vool::VoolMethod.new(name , args_type , locals_type , body )
|
||||
end
|
||||
|
||||
private
|
||||
|
@ -6,7 +6,7 @@ require_relative "passes/method_collector"
|
||||
require_relative "passes/method_compiler"
|
||||
require_relative "passes/locals_collector"
|
||||
require_relative "passes/normalizer"
|
||||
require_relative "ruby_method"
|
||||
require "vool/vool_method"
|
||||
|
||||
|
||||
module Rubyx
|
||||
|
@ -1,29 +0,0 @@
|
||||
module Rubyx
|
||||
|
||||
class RubyMethod
|
||||
|
||||
attr_reader :name , :args_type , :locals_type , :source
|
||||
|
||||
def initialize(name , args_type , locals_type , source )
|
||||
@name , @args_type , @locals_type , @source = name , args_type, locals_type , 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 "locals_type must be type" unless locals_type.is_a?(Parfait::Type)
|
||||
end
|
||||
|
||||
def normalize_source
|
||||
@source = yield @source
|
||||
end
|
||||
|
||||
def create_vm_method( type )
|
||||
raise "create_method #{type.inspect} is not a Type" unless type.is_a? Parfait::Type
|
||||
type.create_method( @name , @args_type )#FIXME, @locals_type)
|
||||
end
|
||||
|
||||
def create_tmp
|
||||
tmp_name = "tmp_#{@locals_type.instance_length}".to_sym
|
||||
@locals_type = @locals_type.add_instance_variable( tmp_name , :Object )
|
||||
tmp_name
|
||||
end
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user