Mutations in block representation; an unfeatured procedure call ()

* Add scratch3_procedures and no-op for defnoreturn

* Add mutation adapter to parse mutations in CREATE/CHANGE events

* Add mutation-to-XML

* Update spec map for Blockly procedure names

* Placeholder for procedure special cases

* Basic stepping to procedures

* Remove extra case

* Validation for changeBlock
This commit is contained in:
Tim Mickel 2016-10-03 17:43:24 -04:00 committed by GitHub
parent dd624aea06
commit 0a66c62f6a
9 changed files with 171 additions and 8 deletions
src/engine

View file

@ -132,6 +132,12 @@ var execute = function (sequencer, thread) {
argValues[inputName] = currentStackFrame.reported[inputName];
}
// Add any mutation to args (e.g., for procedures).
var mutation = target.blocks.getMutation(currentBlockId);
if (mutation) {
argValues.mutation = mutation;
}
// If we've gotten this far, all of the input blocks are evaluated,
// and `argValues` is fully populated. So, execute the block primitive.
// First, clear `currentStackFrame.reported`, so any subsequent execution
@ -155,6 +161,9 @@ var execute = function (sequencer, thread) {
startBranch: function (branchNum) {
sequencer.stepToBranch(thread, branchNum);
},
startProcedure: function (procedureName) {
sequencer.stepToProcedure(thread, procedureName);
},
startHats: function(requestedHat, opt_matchFields, opt_target) {
return (
runtime.startHats(requestedHat, opt_matchFields, opt_target)