remove FieldDef
and on_field_def , :field_def and fixed all related tests local variables will have to be determined outside the typed layer
This commit is contained in:
@ -3,7 +3,7 @@ require_relative "tree"
|
||||
module Typed
|
||||
|
||||
CompilerModules = [ "assignment" , "basic_values" , "call_site",
|
||||
"class_statement" , "collections" , "field_def" , "field_access",
|
||||
"class_statement" , "collections" , "field_access",
|
||||
"function_statement" , "if_statement" , "name_expression" ,
|
||||
"operator_expression" , "return_statement", "statement_list",
|
||||
"while_statement"]
|
||||
@ -98,7 +98,6 @@ module Typed
|
||||
def create_method( class_name , method_name , args = {})
|
||||
raise "create_method #{class_name}.#{class_name.class}" unless class_name.is_a? Symbol
|
||||
clazz = Register.machine.space.get_class_by_name! class_name
|
||||
raise "No such class #{class_name}" unless clazz
|
||||
create_method_for( clazz.instance_type , method_name , args)
|
||||
end
|
||||
|
||||
|
@ -6,9 +6,5 @@ module Typed
|
||||
@name , @value = n , v
|
||||
end
|
||||
end
|
||||
|
||||
class FieldDef < Statement
|
||||
attr_accessor :name , :type , :value
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -40,15 +40,6 @@ module Typed
|
||||
params
|
||||
end
|
||||
|
||||
def on_field_def statement
|
||||
type , name , value = *statement
|
||||
w = Tree::FieldDef.new()
|
||||
w.type = type
|
||||
w.name = process(name)
|
||||
w.value = process(value) if value
|
||||
w
|
||||
end
|
||||
|
||||
def on_while_statement statement
|
||||
branch_type , condition , statements = *statement
|
||||
w = Tree::WhileStatement.new()
|
||||
|
Reference in New Issue
Block a user