From b9e259e11a1602152acf54c7f3ff07bbb0948b35 Mon Sep 17 00:00:00 2001 From: Torsten Ruger Date: Wed, 6 Aug 2014 18:49:20 +0300 Subject: [PATCH] first ginger parfait test --- lib/ast/module_expression.rb | 14 ++++++++++++++ test/virtual/test_machine.rb | 5 ++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/lib/ast/module_expression.rb b/lib/ast/module_expression.rb index bbd9727d..7835674b 100644 --- a/lib/ast/module_expression.rb +++ b/lib/ast/module_expression.rb @@ -19,6 +19,20 @@ module Ast end class ClassExpression < ModuleExpression + def compile method , message + clazz = ::Virtual::Object.space.get_or_create_class name + puts "Created class #{clazz.name.inspect}" +# context.current_class = clazz + expressions.each do |expression| + # check if it's a function definition and add + # if not, execute it, but that does means we should be in salama (executable), not ruby. ie throw an error for now + raise "only functions for now #{expression.inspect}" unless expression.is_a? Ast::FunctionExpression + puts "compiling expression #{expression}" + expression_value = expression.compile(method,message ) + #puts "compiled expression #{expression_value.inspect}" + end + return clazz + end end end \ No newline at end of file diff --git a/test/virtual/test_machine.rb b/test/virtual/test_machine.rb index 08553152..6a326eed 100644 --- a/test/virtual/test_machine.rb +++ b/test/virtual/test_machine.rb @@ -6,9 +6,12 @@ class TestMethods < MiniTest::Test def test_object @string_input = <