From dc198ac79fb1fd534186382c8dc6b8ae2547f04d Mon Sep 17 00:00:00 2001 From: Torsten Ruger Date: Tue, 24 Jun 2014 12:20:38 +0300 Subject: [PATCH] more setter work --- lib/ast/call_site_expression.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/ast/call_site_expression.rb b/lib/ast/call_site_expression.rb index 2e0a9789..7497ae63 100644 --- a/lib/ast/call_site_expression.rb +++ b/lib/ast/call_site_expression.rb @@ -27,11 +27,11 @@ module Ast function = context.current_class.resolve_function(name) end elsif receiver.is_a? VariableExpression - raise "not implemented instance var:#{receiver}" + value_receiver = receiver.compile(context) + function = context.current_class.resolve_function(name) else #This , how does one say nowadays, smells. Smells of unused polymorphism actually raise "Not sure this is possible, but never good to leave elses open #{receiver} #{receiver.class}" - # this lot below should go, since the compile should handle all end raise "No such method error #{inspect}" if (function.nil?) raise "No receiver error #{inspect}:#{receiver}" if (value_receiver.nil?) @@ -50,6 +50,10 @@ module Ast class VariableExpression < CallSiteExpression # super( :_get_instance_variable , [StringExpression.new(name)] ) + def make_setter + @name = :_set_instance_variable + @args << StringExpression.new("value") + end end end \ No newline at end of file