kopia lustrzana https://github.com/backface/turtlestitch
rodzic
8a5e9ab422
commit
897b738526
|
@ -1 +1 @@
|
|||
<blocks app="Snap! 4.1, http://snap.berkeley.edu" version="1"><block-definition s="global variables %'names'" type="command" category="variables"><header></header><code></code><translations></translations><inputs><input type="%mult%txt"></input></inputs><script><block s="doForEach"><l>each item</l><block var="names"/><script><block s="doRun"><block s="reportJSFunction"><list><l>name</l></list><l>if (name != "") this.addVariable(name, true);</l></block><list><block var="each item"/></list></block></script></block><block s="doRun"><block s="reportJSFunction"><list></list><l>var ide = this.parentThatIsA(IDE_Morph);
ide.flushBlocksCache('variables'); // b/c of inheritance
ide.refreshPalette();</l></block><list></list></block></script></block-definition><block-definition s="sprite-local variables %'names'" type="command" category="variables"><header></header><code></code><translations></translations><inputs><input type="%mult%txt"></input></inputs><script><block s="doForEach"><l>each item</l><block var="names"/><script><block s="doRun"><block s="reportJSFunction"><list><l>name</l></list><l>if (name != "") this.addVariable(name, false);</l></block><list><block var="each item"/></list></block></script></block><block s="doRun"><block s="reportJSFunction"><list></list><l>var ide = this.parentThatIsA(IDE_Morph);
ide.flushBlocksCache('variables'); // b/c of inheritance
ide.refreshPalette();</l></block><list></list></block></script></block-definition><block-definition s="%'var' exist?" type="predicate" category="other"><header></header><code></code><translations></translations><inputs><input type="%anyUE"></input></inputs><script><custom-block s="safely try %cs then if %upvar %cs"><script><block s="doIf"><block s="evaluate"><block var="var"/><list></list></block><script></script></block><block s="doReport"><block s="reportBoolean"><l><bool>true</bool></l></block></block></script><l>error</l><script></script></custom-block><block s="doReport"><block s="reportBoolean"><l><bool>false</bool></l></block></block></script></block-definition><block-definition s="safely try %'action' then if %'error' %'handler'" type="command" category="control"><header></header><code></code><translations></translations><inputs><input type="%cs"></input><input type="%upvar"></input><input type="%cs"></input></inputs><script><custom-block s="let %upvar be %s"><l>reset</l><block s="evaluate"><block s="reportJSFunction"><list><l>proc</l></list><l>var oldHandleError = proc.handleError,
 oldCatchingErrors = proc.isCatchingErrors;

return function(){
 proc.handleError = oldHandleError;
 proc.isCatchingErrors = oldCatchingErrors;
}</l></block><list></list></block></custom-block><block s="doCallCC"><block s="reifyScript"><script><block s="doRun"><block s="reportJSFunction"><list><l>reset</l><l>action</l><l>handler</l><l>proc</l></list><l>proc.isCatchingErrors = true;
proc.handleError = function(error, element){
 reset();
 proc.context = handler;
 proc.context.variables.setVar("error", error);
}

try{
 proc.evaluate(action, new List(), true);
}
catch(e){
 proc.handleError(e, null);
} </l></block><list><block var="reset"/><block var="action"/><block s="reifyScript"><script><block s="doRun"><block s="reifyScript"><script><block s="doRun"><block var="handler"/><list></list></block><block s="doRun"><block var="return"/><list></list></block></script><list></list></block><list></list></block></script><list></list></block></list></block></script><list><l>return</l></list></block></block><block s="doRun"><block var="reset"/><list></list></block></script></block-definition></blocks>
|
||||
<blocks app="Snap! 4.2, http://snap.berkeley.edu" version="1"><block-definition s="does variable %'var' exist?" type="predicate" category="variables"><header></header><code></code><translations></translations><inputs><input type="%anyUE"></input></inputs><script><custom-block s="safely try %cs then if %upvar %cs"><script><block s="doIf"><block s="evaluate"><block var="var"/><list></list></block><script></script></block><block s="doReport"><block s="reportBoolean"><l><bool>true</bool></l></block></block></script><l>error</l><script></script></custom-block><block s="doReport"><block s="reportBoolean"><l><bool>false</bool></l></block></block></script></block-definition><block-definition s="global variables %'names'" type="command" category="variables"><header></header><code></code><translations></translations><inputs><input type="%mult%txt"></input></inputs><script><block s="doForEach"><l>each item</l><block var="names"/><script><block s="doRun"><block s="reportJSFunction"><list><l>name</l></list><l>if (name != "") this.addVariable(name, true);</l></block><list><block var="each item"/></list></block></script></block><block s="doRun"><block s="reportJSFunction"><list></list><l>var ide = this.parentThatIsA(IDE_Morph);
ide.flushBlocksCache('variables'); // b/c of inheritance
ide.refreshPalette();</l></block><list></list></block></script></block-definition><block-definition s="sprite-local variables %'names'" type="command" category="variables"><header></header><code></code><translations></translations><inputs><input type="%mult%txt"></input></inputs><script><block s="doForEach"><l>each item</l><block var="names"/><script><block s="doRun"><block s="reportJSFunction"><list><l>name</l></list><l>if (name != "") this.addVariable(name, false);</l></block><list><block var="each item"/></list></block></script></block><block s="doRun"><block s="reportJSFunction"><list></list><l>var ide = this.parentThatIsA(IDE_Morph);
ide.flushBlocksCache('variables'); // b/c of inheritance
ide.refreshPalette();</l></block><list></list></block></script></block-definition><block-definition s="safely try %'action' then if %'error' %'handler'" type="command" category="control"><header></header><code></code><translations></translations><inputs><input type="%cs"></input><input type="%upvar"></input><input type="%cs"></input></inputs><script><block s="errorObsolete"></block><block s="doCallCC"><block s="reifyScript"><script><block s="doRun"><block s="reportJSFunction"><list><l>reset</l><l>action</l><l>handler</l><l>proc</l></list><l>proc.isCatchingErrors = true;
proc.handleError = function(error, element){
 reset();
 proc.context = handler;
 proc.context.variables.setVar("error", error);
}

try{
 proc.evaluate(action, new List(), true);
}
catch(e){
 proc.handleError(e, null);
} </l></block><list><block var="reset"/><block var="action"/><block s="reifyScript"><script><block s="doRun"><block s="reifyScript"><script><block s="doRun"><block var="handler"/><list></list></block><block s="doRun"><block var="return"/><list></list></block></script><list></list></block><list></list></block></script><list></list></block></list></block></script><list><l>return</l></list></block></block><block s="doRun"><block var="reset"/><list></list></block></script></block-definition></blocks>
|
||||
|
|
Ładowanie…
Reference in New Issue