lib/flok/user_compiler.rb in flok-0.0.31 vs lib/flok/user_compiler.rb in flok-0.0.32
- old
+ new
@@ -112,10 +112,11 @@
raise "controller #{@controller.name.inspect} attempted to embed #{spot_name.inspect} inside #{@name.inspect}, but #{spot_name.inspect} was not defined in 'spots' (#{@controller.spots.inspect})" unless spot_index
#Calculate spot index as an offset from the base address using the index of the spot in the spots
#address offset
res = %{
+
var ptr = _embed("#{vc_name}", __base__+#{spot_index}+1, #{context}, __base__);
__info__.embeds[#{spot_index-1}].push(ptr);
}
out.puts res
#Send(event_name, info)
@@ -208,24 +209,25 @@
delete debug_ui_view_to_spot[vp];
<% end %>
}
}
- //Send off event for action change
- main_q.push([3, "if_event", __base__, "action", {
- from: old_action,
- to: "#{action_name}"
- }]);
-
-
//Prep embeds array, embeds[0] refers to the spot bp+2 (bp is vc, bp+1 is main)
__info__.embeds = [];
for (var i = 1; i < #{@controller.spots.count}; ++i) {
__info__.embeds.push([]);
}
+ //Call on_entry for the new action via the singleton on_entry
+ //located in ctable
__info__.cte.actions[__info__.action].on_entry(__base__)
+
+ //Send off event for action change
+ main_q.push([3, "if_event", __base__, "action", {
+ from: old_action,
+ to: "#{action_name}"
+ }]);
}
out.puts res
#Request(service_name, payload, event_name_cb)
elsif l =~ /Request/
l.strip!
@@ -261,21 +263,17 @@
end
end
end
class UserCompilerController
- attr_accessor :root_view, :name, :spots, :macros
+ attr_accessor :name, :spots, :macros
def initialize name, ctx, &block
@name = name
@ctx = ctx
@spots = ['main']
@macros = {}
self.instance_eval(&block)
- end
-
- def view name
- @root_view = name
end
#Create an action macro
def macro name, &block
@macros[name] = block