diff --git a/Gemfile b/Gemfile index 59aab373..6749fc10 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,7 @@ source "http://rubygems.org" gem "salama" , :path => "." -gem "ast" , :github => "whitequark/ast" +gem "ast" #, :github => "whitequark/ast" gem "rake" gem "rye" diff --git a/Gemfile.lock b/Gemfile.lock index b9a2ec0e..5325090a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,12 +1,12 @@ GIT remote: git://github.com/salama/salama-arm.git - revision: 00beb3703b57702e6d8d4743abf7eac2504a3c83 + revision: 866ae7ad961f1a387bfb75526fa170006005b13f specs: - salama-arm (0.3.0) + salama-arm (0.5.0) GIT remote: git://github.com/salama/salama-object-file.git - revision: f2aad98ff93a816aca7b47bea0751974a72b1e72 + revision: aab01b23108f10063433b1ef9f703ff2927d0b80 specs: salama-object-file (0.3.0) @@ -18,12 +18,6 @@ GIT ast (~> 2.1.0) parslet (~> 1.7.1) -GIT - remote: git://github.com/whitequark/ast.git - revision: 63db4686b33228e8f703cb7328e5e5c62aa3cd92 - specs: - ast (2.1.0) - PATH remote: . specs: @@ -37,18 +31,19 @@ GEM specs: annoy (0.5.6) highline (>= 1.5.0) + ast (2.1.0) blankslate (3.1.3) - codeclimate-test-reporter (0.4.8) - simplecov (>= 0.7.1, < 1.0.0) - coderay (1.1.0) + codeclimate-test-reporter (1.0.3) + simplecov + coderay (1.1.1) docile (1.1.5) drydock (0.6.9) - ffi (1.9.10) - ffi (1.9.10-x64-mingw32) + ffi (1.9.14) + ffi (1.9.14-x64-mingw32) formatador (0.2.5) - guard (2.13.0) + guard (2.14.0) formatador (>= 0.2.4) - listen (>= 2.7, <= 4.0) + listen (>= 2.7, < 4.0) lumberjack (~> 1.0) nenv (~> 0.1) notiffany (~> 0.0) @@ -56,41 +51,38 @@ GEM shellany (~> 0.0) thor (>= 0.18.1) guard-compat (1.2.1) - guard-minitest (2.4.4) + guard-minitest (2.4.6) guard-compat (~> 1.2) minitest (>= 3.0) highline (1.7.8) - json (1.8.3) - listen (3.0.3) - rb-fsevent (>= 0.9.3) - rb-inotify (>= 0.9) - lumberjack (1.0.9) + json (2.0.2) + listen (3.1.5) + rb-fsevent (~> 0.9, >= 0.9.4) + rb-inotify (~> 0.9, >= 0.9.7) + ruby_dep (~> 1.2) + lumberjack (1.0.10) method_source (0.8.2) - minitest (5.8.1) - nenv (0.2.0) + minitest (5.10.1) + nenv (0.3.0) net-scp (1.2.1) net-ssh (>= 2.6.5) - net-ssh (3.0.1) - notiffany (0.0.8) + net-ssh (3.2.0) + notiffany (0.1.1) nenv (~> 0.1) shellany (~> 0.0) parser (2.2.3.0) ast (>= 1.1, < 3.0) parslet (1.7.1) blankslate (>= 2.0, <= 4.0) - pry (0.10.2) + pry (0.10.4) coderay (~> 1.1.0) method_source (~> 0.8.1) slop (~> 3.4) - pry (0.10.2-x64-mingw32) - coderay (~> 1.1.0) - method_source (~> 0.8.1) - slop (~> 3.4) - win32console (~> 1.3) rake (11.3.0) - rb-fsevent (0.9.6) - rb-inotify (0.9.5) + rb-fsevent (0.9.8) + rb-inotify (0.9.7) ffi (>= 0.5.0) + ruby_dep (1.5.0) rye (0.9.13) annoy docile (>= 1.0.1) @@ -99,9 +91,9 @@ GEM net-ssh (>= 2.0.13) sysinfo (>= 0.8.1) shellany (0.0.1) - simplecov (0.10.0) + simplecov (0.12.0) docile (~> 1.1.0) - json (~> 1.8) + json (>= 1.8, < 3) simplecov-html (~> 0.10.0) simplecov-html (0.10.0) slop (3.6.0) @@ -109,15 +101,14 @@ GEM sysinfo (0.8.1) drydock storable - thor (0.19.1) - win32console (1.3.2) + thor (0.19.4) PLATFORMS ruby x64-mingw32 DEPENDENCIES - ast! + ast codeclimate-test-reporter guard guard-minitest @@ -130,4 +121,4 @@ DEPENDENCIES soml-parser! BUNDLED WITH - 1.12.5 + 1.13.5 diff --git a/Guardfile b/Guardfile index 69ff2e3b..78a1aa21 100644 --- a/Guardfile +++ b/Guardfile @@ -1,20 +1,6 @@ # A sample Guardfile # More info at https://github.com/guard/guard#readme -## Uncomment and set this to only include directories you want to watch -# directories %w(app lib config test spec features) \ -# .select{|d| Dir.exists?(d) ? d : UI.warning("Directory #{d} does not exist")} - -## Note: if you are using the `directories` clause above and you are not -## watching the project directory ('.'), then you will want to move -## the Guardfile to a watched dir and symlink it back, e.g. -# -# $ mkdir config -# $ mv Guardfile config/ -# $ ln -s config/Guardfile . -# -# and, you'll have to watch "config/Guardfile" instead of "Guardfile" - guard :minitest do # with Minitest::Unit watch(%r{^test/(.*)\/?test_(.*)\.rb$}) diff --git a/lib/register/boot.rb b/lib/register/boot.rb index fcc888bb..69130d07 100644 --- a/lib/register/boot.rb +++ b/lib/register/boot.rb @@ -54,7 +54,6 @@ module Register space_dict = object_with_type Parfait::Dictionary space_dict.keys = object_with_type Parfait::List space_dict.values = object_with_type Parfait::List - @space = object_with_type Parfait::Space @space.classes = space_dict Parfait::Space.set_object_space @space diff --git a/lib/register/parfait/space.rb b/lib/register/parfait/space.rb index 191f61a6..4515b384 100644 --- a/lib/register/parfait/space.rb +++ b/lib/register/parfait/space.rb @@ -38,7 +38,6 @@ module Parfait end end - @@object_space = nil # Make the object space globally available def self.object_space @@object_space diff --git a/test/helper.rb b/test/helper.rb index 53028bcf..507064f4 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -17,8 +17,8 @@ require "minitest/autorun" $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'test')) -require 'salama' - +was = require 'salama' +puts "loaded #{was}" class Ignored def == other diff --git a/test/register/helper.rb b/test/register/helper.rb index 26258082..fba6a8b9 100644 --- a/test/register/helper.rb +++ b/test/register/helper.rb @@ -1 +1,2 @@ require_relative "../helper" +Register.machine.boot unless Register.machine.booted diff --git a/test/register/parfait/test_attributes.rb b/test/register/parfait/test_attributes.rb index 01a27e43..c9dc80c7 100644 --- a/test/register/parfait/test_attributes.rb +++ b/test/register/parfait/test_attributes.rb @@ -18,7 +18,7 @@ class TestAttributes < MiniTest::Test def test_message_name_nil last = @type.instance_names.last assert_equal :indexed_length , last - assert_equal nil , @mess.name + assert_nil @mess.name end def test_message_next_set @mess.next_message = :next_message diff --git a/test/register/parfait/test_class.rb b/test/register/parfait/test_class.rb index ff66e9bd..764ea0a8 100644 --- a/test/register/parfait/test_class.rb +++ b/test/register/parfait/test_class.rb @@ -50,9 +50,9 @@ class TestClass < MiniTest::Test assert_equal Parfait::Method , @try.get_instance_method(:foo).class end def test_method_get_nothere - assert_equal nil , @try.get_instance_method(:foo) + assert_nil @try.get_instance_method(:foo) test_remove_method - assert_equal nil , @try.get_instance_method(:foo) + assert_nil @try.get_instance_method(:foo) end def test_resolve foo = foo_method :Object diff --git a/test/register/parfait/test_dictionary.rb b/test/register/parfait/test_dictionary.rb index 344aea43..03080e91 100644 --- a/test/register/parfait/test_dictionary.rb +++ b/test/register/parfait/test_dictionary.rb @@ -1,7 +1,6 @@ require_relative "../helper" class TestDictionary < MiniTest::Test - Register.machine.boot #have to book, otherwise types etc not set def setup @lookup = ::Parfait::Dictionary.new @@ -10,8 +9,8 @@ class TestDictionary < MiniTest::Test assert @lookup.empty? end def test_empty_dict_doesnt_return - assert_equal nil , @lookup.get(3) - assert_equal nil , @lookup.get(:any) + assert_nil @lookup.get(3) + assert_nil @lookup.get(:any) end def test_one_set1 assert_equal 1 , @lookup.set(1,1) diff --git a/test/register/parfait/test_list.rb b/test/register/parfait/test_list.rb index 43caf234..13a6650c 100644 --- a/test/register/parfait/test_list.rb +++ b/test/register/parfait/test_list.rb @@ -3,7 +3,6 @@ require_relative "../helper" class TestList < MiniTest::Test def setup - Register.machine.boot unless Register.machine.booted @list = ::Parfait::List.new end def test_isa @@ -35,7 +34,7 @@ class TestList < MiniTest::Test def test_length0 assert_equal 0 , @list.get_length - assert_equal nil , @list.indexed_length + assert_nil @list.indexed_length end def test_offset assert_equal 2 , @list.get_offset @@ -67,7 +66,7 @@ class TestList < MiniTest::Test assert_equal 0 , @list.get_length end def test_empty_list_doesnt_return - assert_equal nil , @list.get(3) + assert_nil @list.get(3) end def test_one_set1 assert_equal 2 , @list.set(1,2) @@ -122,7 +121,7 @@ class TestList < MiniTest::Test test_many_get assert_equal 2 , @list.index_of( :two ) assert_equal 3 , @list.index_of( :three ) - assert_equal nil , @list.index_of( :four ) + assert_nil @list.index_of( :four ) end def test_inspect test_many_get @@ -146,13 +145,13 @@ class TestList < MiniTest::Test assert_equal :one , @list.first end def test_first_empty - assert_equal nil , @list.first + assert_nil @list.first end def test_last test_many_get assert_equal :three , @list.last end def test_last_empty - assert_equal nil , @list.last + assert_nil @list.last end end diff --git a/test/register/parfait/test_meta.rb b/test/register/parfait/test_meta.rb index 77268389..03703142 100644 --- a/test/register/parfait/test_meta.rb +++ b/test/register/parfait/test_meta.rb @@ -47,8 +47,8 @@ class TestMeta < MiniTest::Test assert_equal Parfait::Method , @try.get_instance_method(:foo).class end def test_method_get_nothere - assert_equal nil , @try.get_instance_method(:foo) + assert_nil @try.get_instance_method(:foo) test_remove_method - assert_equal nil , @try.get_instance_method(:foo) + assert_nil @try.get_instance_method(:foo) end end diff --git a/test/register/parfait/test_method.rb b/test/register/parfait/test_method.rb index eab4b7e9..14f37a7b 100644 --- a/test/register/parfait/test_method.rb +++ b/test/register/parfait/test_method.rb @@ -3,7 +3,7 @@ require_relative "../helper" class TestMethod < MiniTest::Test def setup - obj = Register.machine.boot.space.get_class_by_name(:Object) + obj = Register.machine.space.get_class_by_name(:Object) args = Parfait.new_list [ Parfait::Variable.new(:Integer , :bar )] @method = ::Parfait::Method.new obj , :foo , args end diff --git a/test/register/parfait/test_object.rb b/test/register/parfait/test_object.rb index f8841977..00f1cc5c 100644 --- a/test/register/parfait/test_object.rb +++ b/test/register/parfait/test_object.rb @@ -14,7 +14,7 @@ class TestObject < MiniTest::Test end def test_empty_object_doesnt_return - assert_equal nil , @object.get_internal_word(3) + assert_nil @object.get_internal_word(3) end def test_one_set1 diff --git a/test/register/parfait/test_space.rb b/test/register/parfait/test_space.rb index f24d0f11..a606f947 100644 --- a/test/register/parfait/test_space.rb +++ b/test/register/parfait/test_space.rb @@ -3,7 +3,7 @@ require_relative "../helper" class TestSpace < MiniTest::Test def setup - @machine = Register.machine.boot + @machine = Register.machine end def classes [:Kernel,:Word,:List,:Message,:Frame,:Type,:Object,:Class,:Dictionary,:Method , :Integer] diff --git a/test/register/parfait/test_word.rb b/test/register/parfait/test_word.rb index 6fd66286..034795b7 100644 --- a/test/register/parfait/test_word.rb +++ b/test/register/parfait/test_word.rb @@ -3,7 +3,6 @@ require_relative "../helper" class TestEmptyWord < MiniTest::Test def setup - Register.machine.boot unless Register.machine.booted @word = ::Parfait::Word.new(0) end def test_word_create diff --git a/test/register/test_instructions.rb b/test/register/test_instructions.rb index 34715a06..da9a949a 100644 --- a/test/register/test_instructions.rb +++ b/test/register/test_instructions.rb @@ -42,12 +42,12 @@ module Register assert_equal @label, @instruction.last end def test_next1 - assert_equal nil , @instruction.next + assert_nil @instruction.next end def test_next2 @instruction.set_next @label assert_equal @label , @instruction.next - assert_equal nil , @instruction.next(2) + assert_nil @instruction.next(2) end def test_replace @instruction.append @branch