update for rubyx integer and api changes

This commit is contained in:
Torsten Ruger 2019-02-09 13:14:01 +02:00
parent dbb400ac08
commit 14297baeeb
4 changed files with 55 additions and 38 deletions

View File

@ -1,6 +1,6 @@
GIT
remote: https://github.com/ruby-x/rx-file
revision: c1de10352d8af105fe532008ceafcdd30b5fbdab
revision: 7c4a5546136d1bad065803da91778b209c18cb4d
specs:
rx-file (0.3.0)
@ -14,31 +14,32 @@ PATH
GEM
remote: https://rubygems.org/
specs:
addressable (2.5.2)
addressable (2.6.0)
public_suffix (>= 2.0.2, < 4.0)
ast (2.4.0)
capybara (2.18.0)
capybara (3.13.2)
addressable
mini_mime (>= 0.1.3)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
xpath (>= 2.0, < 4.0)
nokogiri (~> 1.8)
rack (>= 1.6.0)
rack-test (>= 0.6.3)
regexp_parser (~> 1.2)
xpath (~> 3.2)
childprocess (0.9.0)
ffi (~> 1.0, >= 1.0.11)
chromedriver2-helper (0.0.10)
nokogiri
cliver (0.3.2)
concurrent-ruby (1.1.1)
concurrent-ruby (1.1.4)
diff-lcs (1.3)
ffi (1.9.23)
ffi (1.10.0)
hike (1.2.3)
mini_mime (1.0.0)
mini_portile2 (2.3.0)
mini_mime (1.0.1)
mini_portile2 (2.4.0)
minitest (5.11.3)
nokogiri (1.8.2)
mini_portile2 (~> 2.3.0)
opal (0.11.3)
nokogiri (1.10.1)
mini_portile2 (~> 2.4.0)
opal (0.11.4)
ast (>= 2.3.0)
hike (~> 1.2)
parser (= 2.3.3.1)
@ -53,41 +54,49 @@ GEM
paggio (0.2.6)
parser (2.3.3.1)
ast (~> 2.2)
poltergeist (1.17.0)
capybara (~> 2.1)
poltergeist (1.18.1)
capybara (>= 2.1, < 4)
cliver (~> 0.3.1)
websocket-driver (>= 0.2.0)
public_suffix (3.0.2)
public_suffix (3.0.3)
rack (2.0.6)
rack-test (1.0.0)
rack-test (1.1.0)
rack (>= 1.0, < 3)
rspec (3.7.0)
rspec-core (~> 3.7.0)
rspec-expectations (~> 3.7.0)
rspec-mocks (~> 3.7.0)
rspec-core (3.7.1)
rspec-support (~> 3.7.0)
rspec-expectations (3.7.0)
rb-fsevent (0.10.3)
rb-inotify (0.10.0)
ffi (~> 1.0)
regexp_parser (1.3.0)
rspec (3.8.0)
rspec-core (~> 3.8.0)
rspec-expectations (~> 3.8.0)
rspec-mocks (~> 3.8.0)
rspec-core (3.8.0)
rspec-support (~> 3.8.0)
rspec-expectations (3.8.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.7.0)
rspec-mocks (3.7.0)
rspec-support (~> 3.8.0)
rspec-mocks (3.8.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.7.0)
rspec-support (3.7.1)
rubyzip (1.2.1)
sass (3.4.25)
selenium-webdriver (3.11.0)
rspec-support (~> 3.8.0)
rspec-support (3.8.0)
rubyzip (1.2.2)
sass (3.7.3)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
selenium-webdriver (3.141.0)
childprocess (~> 0.5)
rubyzip (~> 1.2)
rubyzip (~> 1.2, >= 1.2.2)
sourcemap (0.1.1)
sprockets (3.7.2)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
tilt (2.0.8)
tilt (2.0.9)
websocket-driver (0.7.0)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.3)
xpath (3.0.0)
xpath (3.2.0)
nokogiri (~> 1.8)
PLATFORMS
@ -108,4 +117,4 @@ DEPENDENCIES
selenium-webdriver
BUNDLED WITH
1.16.1
1.17.2

View File

@ -36,11 +36,17 @@ class String
arr
end
end
module RubyX
def self.debugger_options
{ parfait: {factory: 50} }
end
end
class MainView < ListView
def initialize
compiler = RubyX::RubyXCompiler.new(RubyX.debugger_options)
input = "class Space;def main(arg); return 1; end; end"
linker = RubyX::RubyXCompiler.new.ruby_to_binary(input , :interpreter)
linker = compiler.ruby_to_binary(input , :interpreter)
@interpreter = Risc::Interpreter.new(linker)
super( [LeftView.new(@interpreter) ,
VoolView.new(@interpreter) ,

View File

@ -66,7 +66,8 @@ class SelectView < ElementView
@interpreter.set_state :stopped
@element.at_css(".selected").text = code
ruby = as_main(get_codes[code])
linker = RubyX::RubyXCompiler.new.ruby_to_binary(ruby, :interpreter)
compiler = RubyX::RubyXCompiler.new(RubyX.debugger_options)
linker = compiler.ruby_to_binary(ruby, :interpreter)
@interpreter.start_program(linker)
end

View File

@ -58,6 +58,7 @@ class StatusView < ElementView
end
def status_text
return unless @interpreter.instruction
return "#{@interpreter.instruction.to_s}" unless @interpreter.instruction.source
source = @interpreter.instruction.source
s = "#{source.to_s}"