diff --git a/app/main/assets/css/app.css.scss b/app/main/assets/css/app.css.scss deleted file mode 100644 index f64375c..0000000 --- a/app/main/assets/css/app.css.scss +++ /dev/null @@ -1 +0,0 @@ -// Place your apps css here \ No newline at end of file diff --git a/app/main/assets/css/hint.css b/app/main/assets/css/hint.css deleted file mode 100644 index 6298eb0..0000000 --- a/app/main/assets/css/hint.css +++ /dev/null @@ -1,307 +0,0 @@ -/*! Hint.css - v1.3.5 - 2015-06-16 -* http://kushagragour.in/lab/hint/ -* Copyright (c) 2015 Kushagra Gour; Licensed MIT */ - -/*-------------------------------------*\ - HINT.css - A CSS tooltip library -\*-------------------------------------*/ -/** - * HINT.css is a tooltip library made in pure CSS. - * - * Source: https://github.com/chinchang/hint.css - * Demo: http://kushagragour.in/lab/hint/ - * - * Release under The MIT License - * - */ -/** - * source: hint-core.scss - * - * Defines the basic styling for the tooltip. - * Each tooltip is made of 2 parts: - * 1) body (:after) - * 2) arrow (:before) - * - * Classes added: - * 1) hint - */ -.hint, [data-hint] { - position: relative; - display: inline-block; - /** - * tooltip arrow - */ - /** - * tooltip body - */ } - .hint:before, .hint:after, [data-hint]:before, [data-hint]:after { - position: absolute; - -webkit-transform: translate3d(0, 0, 0); - -moz-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); - visibility: hidden; - opacity: 0; - z-index: 1000000; - pointer-events: none; - -webkit-transition: 0.3s ease; - -moz-transition: 0.3s ease; - transition: 0.3s ease; - -webkit-transition-delay: 0ms; - -moz-transition-delay: 0ms; - transition-delay: 0ms; } - .hint:hover:before, .hint:hover:after, .hint:focus:before, .hint:focus:after, [data-hint]:hover:before, [data-hint]:hover:after, [data-hint]:focus:before, [data-hint]:focus:after { - visibility: visible; - opacity: 1; } - .hint:hover:before, .hint:hover:after, [data-hint]:hover:before, [data-hint]:hover:after { - -webkit-transition-delay: 100ms; - -moz-transition-delay: 100ms; - transition-delay: 100ms; } - .hint:before, [data-hint]:before { - content: ''; - position: absolute; - background: transparent; - border: 6px solid transparent; - z-index: 1000001; } - .hint:after, [data-hint]:after { - content: attr(data-hint); - background: #383838; - color: white; - padding: 8px 10px; - font-size: 12px; - line-height: 12px; - white-space: nowrap; } - -/** - * source: hint-position.scss - * - * Defines the positoning logic for the tooltips. - * - * Classes added: - * 1) hint--top - * 2) hint--bottom - * 3) hint--left - * 4) hint--right - */ -/** - * set default color for tooltip arrows - */ -.hint--top:before { - border-top-color: #383838; } - -.hint--bottom:before { - border-bottom-color: #383838; } - -.hint--left:before { - border-left-color: #383838; } - -.hint--right:before { - border-right-color: #383838; } - -/** - * top tooltip - */ -.hint--top:before { - margin-bottom: -12px; } -.hint--top:after { - margin-left: -18px; } -.hint--top:before, .hint--top:after { - bottom: 100%; - left: 50%; } -.hint--top:hover:after, .hint--top:hover:before, .hint--top:focus:after, .hint--top:focus:before { - -webkit-transform: translateY(-8px); - -moz-transform: translateY(-8px); - transform: translateY(-8px); } - -/** - * bottom tooltip - */ -.hint--bottom:before { - margin-top: -12px; } -.hint--bottom:after { - margin-left: -18px; } -.hint--bottom:before, .hint--bottom:after { - top: 100%; - left: 50%; } -.hint--bottom:hover:after, .hint--bottom:hover:before, .hint--bottom:focus:after, .hint--bottom:focus:before { - -webkit-transform: translateY(8px); - -moz-transform: translateY(8px); - transform: translateY(8px); } - -/** - * right tooltip - */ -.hint--right:before { - margin-left: -12px; - margin-bottom: -6px; } -.hint--right:after { - margin-bottom: -14px; } -.hint--right:before, .hint--right:after { - left: 100%; - bottom: 50%; } -.hint--right:hover:after, .hint--right:hover:before, .hint--right:focus:after, .hint--right:focus:before { - -webkit-transform: translateX(8px); - -moz-transform: translateX(8px); - transform: translateX(8px); } - -/** - * left tooltip - */ -.hint--left:before { - margin-right: -12px; - margin-bottom: -6px; } -.hint--left:after { - margin-bottom: -14px; } -.hint--left:before, .hint--left:after { - right: 100%; - bottom: 50%; } -.hint--left:hover:after, .hint--left:hover:before, .hint--left:focus:after, .hint--left:focus:before { - -webkit-transform: translateX(-8px); - -moz-transform: translateX(-8px); - transform: translateX(-8px); } - -/** - * source: hint-theme.scss - * - * Defines basic theme for tooltips. - * - */ -.hint, [data-hint] { - /** - * tooltip body - */ } - .hint:after, [data-hint]:after { - text-shadow: 0 -1px 0px black; - box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.3); } - -/** - * source: hint-color-types.scss - * - * Contains tooltips of various types based on color differences. - * - * Classes added: - * 1) hint--error - * 2) hint--warning - * 3) hint--info - * 4) hint--success - * - */ -/** - * Error - */ -.hint--error:after { - background-color: #b34e4d; - text-shadow: 0 -1px 0px #592726; } -.hint--error.hint--top:before { - border-top-color: #b34e4d; } -.hint--error.hint--bottom:before { - border-bottom-color: #b34e4d; } -.hint--error.hint--left:before { - border-left-color: #b34e4d; } -.hint--error.hint--right:before { - border-right-color: #b34e4d; } - -/** - * Warning - */ -.hint--warning:after { - background-color: #c09854; - text-shadow: 0 -1px 0px #6c5328; } -.hint--warning.hint--top:before { - border-top-color: #c09854; } -.hint--warning.hint--bottom:before { - border-bottom-color: #c09854; } -.hint--warning.hint--left:before { - border-left-color: #c09854; } -.hint--warning.hint--right:before { - border-right-color: #c09854; } - -/** - * Info - */ -.hint--info:after { - background-color: #3986ac; - text-shadow: 0 -1px 0px #193b4d; } -.hint--info.hint--top:before { - border-top-color: #3986ac; } -.hint--info.hint--bottom:before { - border-bottom-color: #3986ac; } -.hint--info.hint--left:before { - border-left-color: #3986ac; } -.hint--info.hint--right:before { - border-right-color: #3986ac; } - -/** - * Success - */ -.hint--success:after { - background-color: #458746; - text-shadow: 0 -1px 0px #1a321a; } -.hint--success.hint--top:before { - border-top-color: #458746; } -.hint--success.hint--bottom:before { - border-bottom-color: #458746; } -.hint--success.hint--left:before { - border-left-color: #458746; } -.hint--success.hint--right:before { - border-right-color: #458746; } - -/** - * source: hint-always.scss - * - * Defines a persisted tooltip which shows always. - * - * Classes added: - * 1) hint--always - * - */ -.hint--always:after, .hint--always:before { - opacity: 1; - visibility: visible; } -.hint--always.hint--top:after, .hint--always.hint--top:before { - -webkit-transform: translateY(-8px); - -moz-transform: translateY(-8px); - transform: translateY(-8px); } -.hint--always.hint--bottom:after, .hint--always.hint--bottom:before { - -webkit-transform: translateY(8px); - -moz-transform: translateY(8px); - transform: translateY(8px); } -.hint--always.hint--left:after, .hint--always.hint--left:before { - -webkit-transform: translateX(-8px); - -moz-transform: translateX(-8px); - transform: translateX(-8px); } -.hint--always.hint--right:after, .hint--always.hint--right:before { - -webkit-transform: translateX(8px); - -moz-transform: translateX(8px); - transform: translateX(8px); } - -/** - * source: hint-rounded.scss - * - * Defines rounded corner tooltips. - * - * Classes added: - * 1) hint--rounded - * - */ -.hint--rounded:after { - border-radius: 4px; } - -/** - * source: hint-effects.scss - * - * Defines various transition effects for the tooltips. - * - * Classes added: - * 1) hint--no-animate - * 2) hint--bounce - * - */ -.hint--no-animate:before, .hint--no-animate:after { - -webkit-transition-duration: 0ms; - -moz-transition-duration: 0ms; - transition-duration: 0ms; } - -.hint--bounce:before, .hint--bounce:after { - -webkit-transition: opacity 0.3s ease, visibility 0.3s ease, -webkit-transform 0.3s cubic-bezier(0.71, 1.7, 0.77, 1.24); - -moz-transition: opacity 0.3s ease, visibility 0.3s ease, -moz-transform 0.3s cubic-bezier(0.71, 1.7, 0.77, 1.24); - transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s cubic-bezier(0.71, 1.7, 0.77, 1.24); } diff --git a/app/main/assets/images/bunny.png b/app/main/assets/images/bunny.png deleted file mode 100644 index a773287..0000000 Binary files a/app/main/assets/images/bunny.png and /dev/null differ diff --git a/app/main/config/dependencies.rb b/app/main/config/dependencies.rb deleted file mode 100644 index 0c33e83..0000000 --- a/app/main/config/dependencies.rb +++ /dev/null @@ -1,11 +0,0 @@ -# Specify which components you wish to include when -# the "home" component loads. - -# bootstrap css framework -component 'bootstrap' - -Opal.use_gem("salama-reader") -Opal.use_gem("salama-object-file") -Opal.append_path "app/main/lib" - -css_file "hint.css" diff --git a/app/main/config/initializers/boot.rb b/app/main/config/initializers/boot.rb deleted file mode 100644 index a4bbae3..0000000 --- a/app/main/config/initializers/boot.rb +++ /dev/null @@ -1,10 +0,0 @@ -# Place any code you want to run when the component is included on the client -# or server. - -# To include code only on the client use: -# if RUBY_PLATFORM == 'opal' -# -# To include code only on the server, use: -# unless RUBY_PLATFORM == 'opal' -# ^^ this will not send compile in code in the conditional to the client. -# ^^ this include code required in the conditional. \ No newline at end of file diff --git a/app/main/config/initializers/client/phaser.rb b/app/main/config/initializers/client/phaser.rb deleted file mode 100644 index e69de29..0000000 diff --git a/app/main/config/routes.rb b/app/main/config/routes.rb deleted file mode 100644 index 2724777..0000000 --- a/app/main/config/routes.rb +++ /dev/null @@ -1,7 +0,0 @@ -# See https://github.com/voltrb/volt#routes for more info on routes - -client '/about', action: 'about' - -# The main route, this should be last. It will match any params not -# previously matched. -client '/', {} diff --git a/app/main/controllers/main_controller.rb b/app/main/controllers/main_controller.rb deleted file mode 100644 index 9b65957..0000000 --- a/app/main/controllers/main_controller.rb +++ /dev/null @@ -1,69 +0,0 @@ - -require "opal/parser" # to get eval to work - -$LOAD_PATH.unshift("/Users/raisa/salama/salama-debugger/app/main/lib") - -require "salama" - -Virtual::Machine.boot - -module Main - class MainController < Volt::ModelController - - def index - page._registers!.clear - page._classes!.clear - page._objects!.clear - page._source = InstructionModel.new nil - page._block = BlockModel.new nil - fill_regs - parse_and_fill - end - - def about - - end - - private - - def parse_and_fill - ParseTask.parse(1).then do |result| - is = Ast::Expression.from_basic(result) - Virtual::Compiler.compile( is , Virtual.machine.space.get_main ) - Virtual.machine.run_before "Register::CallImplementation" - fill_classes - end.fail do |error| - raise "Error: #{error}" - end - end - def fill_classes - Virtual.machine.space.classes.each do |name , claz| - next if [:Kernel,:Module,:MetaClass,:BinaryCode].index name - c = Volt::Model.new :name => name - page._classes << c - end - b = Virtual.machine.init - page._block = BlockModel.new b - page._source = InstructionModel.new b.codes.first.source - end - def fill_regs - register_names = (0..8).collect {|i| "r#{i}"} - register_names.each do |reg_name| - reg = Volt::Model.new :name => reg_name - page._registers << reg - end - end - # The main template contains a #template binding that shows another - # template. This is the path to that template. It may change based - # on the params._component, params._controller, and params._action values. - def main_path - "#{params._component || 'main'}/#{params._controller || 'main'}/#{params._action || 'index'}" - end - - # Determine if the current nav component is the active one by looking - # at the first part of the url against the href attribute. - def active_tab? - url.path.split('/')[1] == attrs.href.split('/')[1] - end - end -end diff --git a/app/main/lib/object_view.rb b/app/main/lib/object_view.rb deleted file mode 100644 index 4384e02..0000000 --- a/app/main/lib/object_view.rb +++ /dev/null @@ -1,29 +0,0 @@ - -class ObjectView - - attr_accessor :text , :object , :attributes - - def initialize o - super() - puts "NO O " unless o - self.object = o - self.text = short - @attributes = {} - end - - def short - object.class.name.split("::").last[0 .. 3] - end - - def is_parfait - object.class.name.split("::").first == "Parfait" - end - def set name , val - @attributes[name] = val - self.text.text = short + @attributes.length.to_s - end - def get(name) - @attributes[name] - end - -end diff --git a/app/main/lib/space_view.rb b/app/main/lib/space_view.rb deleted file mode 100644 index b85b192..0000000 --- a/app/main/lib/space_view.rb +++ /dev/null @@ -1,99 +0,0 @@ - -class SpaceView - include Sof::Util - - def initialize max - super() - - space = Virtual.machine.space - # just a way to get the space into a list. objects is an id => occurence mapping. - # occurence.object is the object - objects = Sof::Members.new(space).objects - @objects = objects - puts "Objects #{objects.length}" - # create a mapping from id to volt models - @view_objects = {} - - @objects.each do |i , o| - ob = o.object - next unless ob - next if basic?(ob) - next if ob.class.name.include? "Binary" - next if ob.class.name.include? "Array" - puts "object #{ob.class.name}" - - view = ObjectView.new ob - @view_objects[i] = view - add_child view.text - end - fill_attributes - end - - - def fill_attributes - @view_objects.each do |i , view| - ob = view.object - next if is_value?(ob) - case ob.class.name - when "Array" , "Parfait::List" - fill_array view - when "Hash" , "Parfait::Dictionary" - fill_hash view - else -# next if basic?(ob) - - attributes = attributes_for(ob) - attributes.each do |a| - next if a == "html_safe" - next if a == "constructor" - next if a == "toString" - next if a == "position" - val = get_value( ob , a) - if( @view_objects[val.object_id]) - val = @view_objects[val.object_id] - end - #puts "set #{a}" - view.set(a , val ) - end - superclasses = [ob.class.superclass.name] - if superclasses.include?( "Array") or superclasses.include?( "Parfait::List") - fill_array view - end - if superclasses.include?( "Hash") or superclasses.include?( "Parfait::Dictionary") - fill_hash view - end - end - end - end - - def basic? ob - return true if ob.class.name.include?("::") and !ob.class.name.include?("Parfait") - return true if ob.class.name == "Proc" - return true if ob.class.name == "String" - return true if ob.class.name == "Numeric" - return true if ob.class.name == "Class" - false - end - # and hash keys/values - def fill_hash view_hash - view_hash.object.each do |k , val| - if( @view_objects[val.object_id]) - val = @view_objects[val.object_id] - end - view_hash.set(k , val ) - end - end - # and array values - def fill_array view_array - index = 0 - view_array.object.each do |val| - if( @view_objects[val.object_id]) - val = @view_objects[val.object_id] - end - view_array.set("#{index}" , val ) - index += 1 - end - #puts "set #{a}" - end - -end diff --git a/app/main/models/block_model.rb b/app/main/models/block_model.rb deleted file mode 100644 index f61e8bc..0000000 --- a/app/main/models/block_model.rb +++ /dev/null @@ -1,13 +0,0 @@ - -# represent a block and hold the actual instance (as transient) - -class BlockModel < Volt::Model - field :name - attr_accessor :block - - def initialize(b) - super() - @block = b - self.name = b.nil? ? 'undefined' : b.name - end -end diff --git a/app/main/models/instruction_model.rb b/app/main/models/instruction_model.rb deleted file mode 100644 index 86717f2..0000000 --- a/app/main/models/instruction_model.rb +++ /dev/null @@ -1,13 +0,0 @@ - -# represent an instruction and hold the actual instance (as transient) - -class InstructionModel < Volt::Model - field :name - attr_accessor :instruction - - def initialize(i) - super() - @instruction = i - self.name = i.class.name - end -end diff --git a/app/main/tasks/parse_task.rb b/app/main/tasks/parse_task.rb deleted file mode 100644 index 47ccb8d..0000000 --- a/app/main/tasks/parse_task.rb +++ /dev/null @@ -1,11 +0,0 @@ -require "salama-reader" - -class ParseTask < Volt::Task - def parse(num) - string_input = '"Hello again".putstring()' - parser = Parser::Salama.new - out = parser.parse(string_input) - parts = Parser::Transform.new.apply(out) - parts.to_basic - end -end diff --git a/app/main/views/main/about.html b/app/main/views/main/about.html deleted file mode 100644 index 7720e4c..0000000 --- a/app/main/views/main/about.html +++ /dev/null @@ -1,7 +0,0 @@ -<:Title> - About - -<:Body> -
About page...
diff --git a/app/main/views/main/index.html b/app/main/views/main/index.html deleted file mode 100644 index 48abc71..0000000 --- a/app/main/views/main/index.html +++ /dev/null @@ -1,43 +0,0 @@ -<:Title> - Debugger - -<:Body> -