Update make-variables.xml

Change name and color of exist? predicate.
pull/68/head
Brian Harvey 2018-10-25 23:57:14 -04:00 zatwierdzone przez GitHub
rodzic 8a5e9ab422
commit 897b738526
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -1 +1 @@
<blocks app="Snap! 4.1, http://snap.berkeley.edu" version="1"><block-definition s="global variables %&apos;names&apos;" 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);&#xD;ide.flushBlocksCache(&apos;variables&apos;); // b/c of inheritance&#xD;ide.refreshPalette();</l></block><list></list></block></script></block-definition><block-definition s="sprite-local variables %&apos;names&apos;" 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);&#xD;ide.flushBlocksCache(&apos;variables&apos;); // b/c of inheritance&#xD;ide.refreshPalette();</l></block><list></list></block></script></block-definition><block-definition s="%&apos;var&apos; 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 %&apos;action&apos; then if %&apos;error&apos; %&apos;handler&apos;" 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,&#xD; oldCatchingErrors = proc.isCatchingErrors;&#xD;&#xD;return function(){&#xD; proc.handleError = oldHandleError;&#xD; proc.isCatchingErrors = oldCatchingErrors;&#xD;}</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;&#xD;proc.handleError = function(error, element){&#xD; reset();&#xD; proc.context = handler;&#xD; proc.context.variables.setVar("error", error);&#xD;}&#xD;&#xD;try{&#xD; proc.evaluate(action, new List(), true);&#xD;}&#xD;catch(e){&#xD; proc.handleError(e, null);&#xD;} </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 %&apos;var&apos; 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 %&apos;names&apos;" 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);&#xD;ide.flushBlocksCache(&apos;variables&apos;); // b/c of inheritance&#xD;ide.refreshPalette();</l></block><list></list></block></script></block-definition><block-definition s="sprite-local variables %&apos;names&apos;" 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);&#xD;ide.flushBlocksCache(&apos;variables&apos;); // b/c of inheritance&#xD;ide.refreshPalette();</l></block><list></list></block></script></block-definition><block-definition s="safely try %&apos;action&apos; then if %&apos;error&apos; %&apos;handler&apos;" 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;&#xD;proc.handleError = function(error, element){&#xD; reset();&#xD; proc.context = handler;&#xD; proc.context.variables.setVar("error", error);&#xD;}&#xD;&#xD;try{&#xD; proc.evaluate(action, new List(), true);&#xD;}&#xD;catch(e){&#xD; proc.handleError(e, null);&#xD;} </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>