Add mom boot options

and remove a lot of stale parfait boots from tests
(from before using rubyxc)
This commit is contained in:
2019-09-07 16:43:47 +03:00
parent 1539904ee2
commit 2c681bf2e5
25 changed files with 16 additions and 39 deletions

View File

@ -26,7 +26,7 @@ module Mom
#
# We create an empty main for init to jump to, if no code is compiled, that just returns
# See Builtin directory readme and module
def self.boot_functions()
def self.boot_functions( options = {})
# TODO go through the virtual parfait layer and adjust function names
# to what they really are
compilers = []

View File

@ -13,8 +13,8 @@
module Mom
# boot bubiltin function (subject to change)
def self.boot!
Builtin.boot_functions
def self.boot!(options = {})
Builtin.boot_functions(options)
end
end

View File

@ -42,6 +42,5 @@ module Mom
Risc::RiscCollection.new(riscs)
end
end
end

View File

@ -15,7 +15,7 @@ end
# See risc/Readme
module Risc
# module method to reset, and init
def self.boot!
def self.boot!(options = {})
Position.clear_positions
end
end

View File

@ -19,11 +19,18 @@ thus "typing" the syntax tree, and making it concrete.
## to Vool
In our nice layers, we are ont the way down to Vool, a simplified version of oo.
In our nice layers, we are on the way down to Vool, a simplified version of oo.
It has proven handy to have this layer, so the code for transforming each object
is in the class representing that object. (As one does in oo, again imho).
## compile_time_expansions
We do some expansions at compile time that are in fact methods calls in real ruby.
First among those will be require (+ require_relative) , but attribute readers
will surely follow.
## Parfait objects
The compilation process ends up creating (parfait) objects to represent

View File

@ -25,13 +25,14 @@ module RubyX
#
class RubyXCompiler
attr_reader :vool
attr_reader :vool , :options
# initialize boots Parfait and Risc (ie load Builin)
def initialize(options)
@options = options
Parfait.boot!(options[:parfait] || {})
Mom.boot!
Risc.boot!
Mom.boot!(options[:mom] || {})
Risc.boot!(options[:risc] || {})
end
# The highest level function creates binary code for the given ruby code