remove volt
This commit is contained in:
parent
5c2f423f58
commit
bd882b7d2e
@ -1 +0,0 @@
|
|||||||
// Place your apps css here
|
|
@ -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); }
|
|
Binary file not shown.
Before Width: | Height: | Size: 237 B |
@ -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"
|
|
@ -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.
|
|
@ -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 '/', {}
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -1,7 +0,0 @@
|
|||||||
<:Title>
|
|
||||||
About
|
|
||||||
|
|
||||||
<:Body>
|
|
||||||
<h1>About</h1>
|
|
||||||
|
|
||||||
<p>About page...</p>
|
|
@ -1,43 +0,0 @@
|
|||||||
<:Title>
|
|
||||||
Debugger
|
|
||||||
|
|
||||||
<:Body>
|
|
||||||
<div class="row">
|
|
||||||
{{ page._classes.each do |c| }}
|
|
||||||
<div class="col-md-1">
|
|
||||||
{{ c._name }} <br/>
|
|
||||||
</div>
|
|
||||||
{{ end }}
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-3">
|
|
||||||
Messages
|
|
||||||
</div>
|
|
||||||
<div class="col-md-3">
|
|
||||||
Source Code
|
|
||||||
</div>
|
|
||||||
<div class="col-md-3">
|
|
||||||
<div class="row">
|
|
||||||
Virtual Machine Instruction : {{ page._source._name}}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-md-3">
|
|
||||||
<div class="row">
|
|
||||||
Current block: {{ page._block._name}}
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
{{ if page._block.block }}
|
|
||||||
{{ page._block.block.codes.each do |c| }}
|
|
||||||
{{ c.to_s }}
|
|
||||||
{{ end }}
|
|
||||||
{{ end }}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
{{ page._registers.each do |r| }}
|
|
||||||
<div class="col-md-1">
|
|
||||||
{{ r._name }} : {{ r._content }}
|
|
||||||
</div>
|
|
||||||
{{ end }}
|
|
||||||
</div>
|
|
@ -1,27 +0,0 @@
|
|||||||
<:Title>
|
|
||||||
{{ view main_path, "title", {controller_group: 'main'} }}
|
|
||||||
|
|
||||||
<:Body>
|
|
||||||
<div class="container">
|
|
||||||
<div class="header">
|
|
||||||
<ul class="nav nav-pills pull-right">
|
|
||||||
<:nav href="/">Home</:nav>
|
|
||||||
<:nav href="/about">About</:nav>
|
|
||||||
</ul>
|
|
||||||
<h3 class="text-muted">Salama Debugger</h3>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<:volt:notices />
|
|
||||||
|
|
||||||
{{ view main_path, 'body', {controller_group: 'main'} }}
|
|
||||||
|
|
||||||
<div class="footer">
|
|
||||||
<p> <a href="http://salama-vm.org/" >Salama</a> {{ Time.now.year }}</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<:Nav>
|
|
||||||
<li class="{{ if active_tab? }}active{{ end }}">
|
|
||||||
<a href="{{ attrs.href }}">{{ yield }}</a>
|
|
||||||
</li>
|
|
132
config/app.rb
132
config/app.rb
@ -1,132 +0,0 @@
|
|||||||
# app.rb is used to configure your app. This code is only run on the server,
|
|
||||||
# then any config options in config.public are passed to the client as well.
|
|
||||||
|
|
||||||
Volt.configure do |config|
|
|
||||||
# Setup your global app config here.
|
|
||||||
|
|
||||||
#######################################
|
|
||||||
# Basic App Info (stuff you should set)
|
|
||||||
#######################################
|
|
||||||
config.domain = 'salama-vm.org'
|
|
||||||
config.app_name = 'Salama-debugger'
|
|
||||||
config.mailer.from = 'Salama-debugger <no-reply@salama-debugger.com>'
|
|
||||||
|
|
||||||
############
|
|
||||||
# App Secret
|
|
||||||
############
|
|
||||||
# Your app secret is used for signing things like the user cookie so it can't
|
|
||||||
# be tampered with. A random value is generated on new projects that will work
|
|
||||||
# without the need to customize. Make sure this value doesn't leave your server.
|
|
||||||
#
|
|
||||||
# For added security we recommend moving the app secret into an environment. You can
|
|
||||||
# setup that like so:
|
|
||||||
#
|
|
||||||
# config.app_secret = ENV['APP_SECRET']
|
|
||||||
#
|
|
||||||
config.app_secret = 'pKDKhKInTaI5EVH9WmyN-cJSYnJt8PmDogwW63Zqr_ieUNqYvh1KybeWJoslylzFgsU'
|
|
||||||
|
|
||||||
###############
|
|
||||||
# Log Filtering
|
|
||||||
###############
|
|
||||||
# Data updates from the client come in via Tasks. The task dispatcher logs all calls to tasks.
|
|
||||||
# By default hashes in the arguments can be filtered based on keys. So any hash with a key of
|
|
||||||
# password will be filtered. You can add more fields to filter below:
|
|
||||||
config.filter_keys = [:password]
|
|
||||||
|
|
||||||
##########
|
|
||||||
# Database
|
|
||||||
##########
|
|
||||||
# Database config all start with db_ and can be set either in the config
|
|
||||||
# file or with an environment variable (DB_NAME for example).
|
|
||||||
|
|
||||||
# config.db_driver = 'mongo'
|
|
||||||
# config.db_name = (config.app_name + '_' + Volt.env.to_s)
|
|
||||||
# config.db_host = 'localhost'
|
|
||||||
# config.db_port = 27017
|
|
||||||
|
|
||||||
#####################
|
|
||||||
# Compression options
|
|
||||||
#####################
|
|
||||||
# If you are not running behind something like nginx in production, you can
|
|
||||||
# have rack deflate all files.
|
|
||||||
# config.deflate = true
|
|
||||||
|
|
||||||
#######################
|
|
||||||
# Public configurations
|
|
||||||
#######################
|
|
||||||
# Anything under config.public will be sent to the client as well as the server,
|
|
||||||
# so be sure no private data ends up under public
|
|
||||||
|
|
||||||
# Use username instead of email as the login
|
|
||||||
# config.public.auth.use_username = true
|
|
||||||
|
|
||||||
#####################
|
|
||||||
# Compression Options
|
|
||||||
#####################
|
|
||||||
# Disable or enable css/js compression. Default is to only run in production.
|
|
||||||
# if Volt.env.production?
|
|
||||||
# config.compress_javascript = true
|
|
||||||
# config.compress_css = true
|
|
||||||
# end
|
|
||||||
|
|
||||||
################
|
|
||||||
# Mailer options
|
|
||||||
################
|
|
||||||
# The volt-mailer gem uses pony (https://github.com/benprew/pony) to deliver e-mail. Any
|
|
||||||
# options you would pass to pony can be setup below.
|
|
||||||
# NOTE: The from address is setup at the top
|
|
||||||
|
|
||||||
# Normally pony uses /usr/sbin/sendmail if one is installed. You can specify smtp below:
|
|
||||||
# config.mailer.via = :smtp
|
|
||||||
# config.mailer.via_options = {
|
|
||||||
# :address => 'smtp.yourserver.com',
|
|
||||||
# :port => '25',
|
|
||||||
# :user_name => 'user',
|
|
||||||
# :password => 'password',
|
|
||||||
# :authentication => :plain, # :plain, :login, :cram_md5, no auth by default
|
|
||||||
# :domain => "localhost.localdomain" # the HELO domain provided by the client to the server
|
|
||||||
# }
|
|
||||||
|
|
||||||
#############
|
|
||||||
# Message Bus
|
|
||||||
#############
|
|
||||||
# Volt provides a "Message Bus" out of the box. The message bus provides
|
|
||||||
# a pub/sub service between any volt instance (server, client, runner, etc..)
|
|
||||||
# that share the same database. The message bus can be used by app code. It
|
|
||||||
# is also used internally to push data to any listening clients.
|
|
||||||
#
|
|
||||||
# The default message bus (called "peer_to_peer") uses the database to sync
|
|
||||||
# socket ip's/ports.
|
|
||||||
# config.message_bus.bus_name = 'peer_to_peer'
|
|
||||||
#
|
|
||||||
# Encrypt message bus - messages on the message bus are encrypted by default
|
|
||||||
# but this is meant to be used locally by a developer
|
|
||||||
config.message_bus.disable_encryption = true
|
|
||||||
#
|
|
||||||
# ## MessageBus Server -- the message bus binds to a port and ip which the
|
|
||||||
# other volt instances need to be able to connect to. You can customize
|
|
||||||
# the server below:
|
|
||||||
#
|
|
||||||
# Port range - you can specify a range of ports that an instance can bind the
|
|
||||||
# message bus on. You can specify a range, an array of Integers, or an array
|
|
||||||
# of ranges.
|
|
||||||
# config.message_bus.bind_port_ranges = (58000..61000)
|
|
||||||
#
|
|
||||||
# Bind Ip - specifies the ip address the message bus server should bind on.
|
|
||||||
# config.message_bus.bind_ip = '127.0.0.1'
|
|
||||||
|
|
||||||
#############
|
|
||||||
# Concurrency
|
|
||||||
#############
|
|
||||||
# Volt provides a thread worker pool for incoming task requests (and all
|
|
||||||
# database requests, since those use tasks to do their work.) The following
|
|
||||||
# lets you control the size of the worker pool. Threads are only created as
|
|
||||||
# needed, and are removed after a certain amount of inactivity.
|
|
||||||
# config.min_worker_threads = 1
|
|
||||||
# config.max_worker_threads = 10
|
|
||||||
#
|
|
||||||
# You can also specify the amount of time a Task should run for before it
|
|
||||||
# timeout's. Setting this to short can cause unexpected results, currently
|
|
||||||
# we recomend it be at least 10 seconds.
|
|
||||||
# config.worker_timeout = 60
|
|
||||||
end
|
|
@ -1,20 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<%# IMPORTANT: Please read before changing! %>
|
|
||||||
<%# This file is rendered on the server using ERB, so it does NOT use Volt's %>
|
|
||||||
<%# normal template system. You can add to it, but keep in mind the template %>
|
|
||||||
<%# language difference. This file handles auto-loading all JS/Opal and CSS. %>
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8" />
|
|
||||||
<% javascript_files.each do |javascript_file| %>
|
|
||||||
<script src="<%= javascript_file %>"></script>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
<% css_files.each do |css_file| %>
|
|
||||||
<link href="<%= css_file %>" media="all" rel="stylesheet" type="text/css" />
|
|
||||||
<% end %>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@ -1,2 +0,0 @@
|
|||||||
puts "parser"
|
|
||||||
require "opal/parser"
|
|
Loading…
Reference in New Issue
Block a user