From fae0c1ab8c1debe626e98a28ea12d467be736245 Mon Sep 17 00:00:00 2001 From: Torsten Ruger Date: Fri, 2 May 2014 08:14:38 +0300 Subject: [PATCH] renamed program to assembler (to avoid clashes in vm) --- lib/asm/{program.rb => assembler.rb} | 6 +++--- lib/asm/block.rb | 2 +- lib/crystal.rb | 2 +- test/test_crystal.rb | 4 ++-- test/test_runner.rb | 2 +- test/test_small_program.rb | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) rename lib/asm/{program.rb => assembler.rb} (94%) diff --git a/lib/asm/program.rb b/lib/asm/assembler.rb similarity index 94% rename from lib/asm/program.rb rename to lib/asm/assembler.rb index 83983521..b095f2bc 100644 --- a/lib/asm/program.rb +++ b/lib/asm/assembler.rb @@ -6,14 +6,14 @@ require "asm/string_literal" module Asm - # Program is the the top-level of the code hierachy, except it is not derived from code - # instead a Program is a list of blocks (and string constants) + # Assembler is the the top-level of the code hierachy, except it is not derived from code + # instead a Assembler is a list of blocks (and string constants) # All code is created in blocks (see there) and there are two styles for that, for forward of backward # referencing. Read function block and add_block and Block.set - class Program + class Assembler def initialize @blocks = [] diff --git a/lib/asm/block.rb b/lib/asm/block.rb index f6376d5f..ab783b6a 100644 --- a/lib/asm/block.rb +++ b/lib/asm/block.rb @@ -119,7 +119,7 @@ module Asm end # length of the codes. In arm it would be the length * 4 - # (strings are stored globally in the Program) + # (strings are stored globally in the Assembler) def length @codes.inject(0) {| sum , item | sum + item.length} end diff --git a/lib/crystal.rb b/lib/crystal.rb index d7ea5cf3..16f296e1 100644 --- a/lib/crystal.rb +++ b/lib/crystal.rb @@ -1,6 +1,6 @@ require 'parslet' -require "asm/program" +require "asm/assembler" require "elf/object_writer" require 'parser/composed' require 'parser/transform' diff --git a/test/test_crystal.rb b/test/test_crystal.rb index 7ad6683e..75d6e2f4 100644 --- a/test/test_crystal.rb +++ b/test/test_crystal.rb @@ -6,9 +6,9 @@ require_relative 'helper' # adc add and bic eor orr rsb rsc sbc sub mov mvn cmn cmp teq tst b bl bx swi strb class TestArmAsm < MiniTest::Test - # need Program and a block (see those classes) + # need Assembler and a block (see those classes) def setup - @program = Asm::Program.new + @program = Asm::Assembler.new #no ruby block given, ie need to add this block later by hand @block = @program.block end diff --git a/test/test_runner.rb b/test/test_runner.rb index 1bf4f887..df03e24c 100644 --- a/test/test_runner.rb +++ b/test/test_runner.rb @@ -26,7 +26,7 @@ class TestRunner < MiniTest::Test # execute # check result ? context = Vm::Context.new - builder = Asm::Program.new + builder = Asm::Assembler.new compiled = tree.compile( builder , context ) puts compiled.inspect end diff --git a/test/test_small_program.rb b/test/test_small_program.rb index cd6ee822..fb80c458 100644 --- a/test/test_small_program.rb +++ b/test/test_small_program.rb @@ -9,7 +9,7 @@ require_relative 'helper' class TestSmallProg < MiniTest::Test # need a code generator, for arm def setup - @program = Asm::Program.new + @program = Asm::Assembler.new end def test_loop