From 9832c8730b81700d1ca9e9c503700ae7cdde11d3 Mon Sep 17 00:00:00 2001 From: Torsten Ruger Date: Tue, 15 May 2018 12:07:52 +0300 Subject: [PATCH] still +1 errors also bigger risc view --- assets/css/app.css.sass | 7 +++---- lib/views/left_view.rb | 1 + lib/views/object_view.rb | 6 +++--- lib/views/risc_view.rb | 3 +-- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/assets/css/app.css.sass b/assets/css/app.css.sass index 75fb5cc..1243e7b 100644 --- a/assets/css/app.css.sass +++ b/assets/css/app.css.sass @@ -18,15 +18,15 @@ body margin-left: 1% .vool_view - width: 14% + width: 12% margin-left: 1% .mom_view - width: 24% + width: 16% margin-left: 1% .risc_view - width: 24% + width: 34% margin-left: 1% .status_view @@ -82,7 +82,6 @@ body .risc_bright , .mom_bright background-color: black - font-size: 1.2rem color: #53a5ff border-radius: 7px diff --git a/lib/views/left_view.rb b/lib/views/left_view.rb index 1c4902f..f778d85 100644 --- a/lib/views/left_view.rb +++ b/lib/views/left_view.rb @@ -72,6 +72,7 @@ class SelectView < ElementView { while_with_calls: 'a = 0; while( 0 > a); a = 1 + a;end;return a', set_internal_byte: "return 'Hello'.set_internal_byte(1,75)" , called_if: 'if( 10 ); return "then";else;return "else";end' , + plus: 'return 5 + 7' , hello_world: "h = 'Hello World'.putstring;return h", dynamic_call: "a = 150 ; return a.div10", } diff --git a/lib/views/object_view.rb b/lib/views/object_view.rb index 4e91e8e..21ef735 100644 --- a/lib/views/object_view.rb +++ b/lib/views/object_view.rb @@ -32,8 +32,8 @@ class ObjectView < ListView end #puts "got var name #{variable}#{variable.class} for #{at}, #{f}" view = RefView.new( variable , f , @z ) - if( @children[at] ) - replace_at(at , view) + if( @children[at + 1] ) + replace_at(at + 1, view) else append_view(view) end @@ -53,7 +53,7 @@ class ObjectView < ListView fields << RefView.new( variable , f , @z ) end if( object.is_a?(Parfait::List) ) - index = 1 + index = 0 object.each do | o| fields << RefView.new( index.to_s , o , @z ) index += 1 diff --git a/lib/views/risc_view.rb b/lib/views/risc_view.rb index b9aca4f..2d2a71c 100644 --- a/lib/views/risc_view.rb +++ b/lib/views/risc_view.rb @@ -36,8 +36,7 @@ class RiscView < ListView def instruction_text return "" unless @interpreter.instruction - text = @interpreter.instruction.to_s - text.split("(").first + @interpreter.instruction.to_s.split("(").first end end