check for redefining of methods and forbid

causing some test problems, but better that way (until it's done right off course)
This commit is contained in:
2019-09-24 21:20:12 +03:00
parent 3df54910cc
commit 1022390e0f
9 changed files with 45 additions and 24 deletions

View File

@ -1,12 +1,12 @@
module Preloader
def get_preload(preload)
return "" unless preload
preload = Vool::Builtin.builtin.keys.join(";") if(preload == "all" )
preload.split(";").collect do |loads|
raise "no preload #{loads}" unless Vool::Builtin.builtin[loads]
clazz , meth = loads.split(".")
"class #{clazz} #{Vool::Builtin.derive(clazz)}; #{Vool::Builtin.builtin[loads]};end;"
end.join
if( preload == "all" )
loading = Vool::Builtin.builtin.keys
else
loading = preload.split(";")
end
loading.collect { |loads| Vool::Builtin.load_builtin(loads)}.join(";") + ";"
end
def preload
get_preload(@preload)

View File

@ -105,7 +105,7 @@ module Risc
# use the input as it, compile and run it
# input muts contain a Space.main, but may contain more classes and methods
def run_input(input)
@string_input = preload + input
@string_input = input
do_setup
run_all
end