<snapdata remixID="15110304"><project name="Calculator using only Snap! blocks" app="Snap! 11.0.8, https://snap.berkeley.edu" version="2"><notes>I made a calculator using only Snap! blocks.</notes><thumbnail>data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAB4CAYAAAB1ovlvAAAEDUlEQVR4AeyVMUpkQRRFH4qhZqauxEwUzUV0AwoauBYDA1egiLGIaOZKTM00MZthlAYnqP5/uqZ+3ap7GqSb+r+q3j33gEu/+ECgIoGl4AOBigQQsCJ8ro5AQCyoSgABq+LncgTEgaoEfAWsip3LZwQQcEaC7yoEELAKdi6dEUDAGQm+qxBAwCrYuXRGAAFnJPiuQgABq2CveqnU5QgoVYffMAjo17lUYgSUqsNvGAT061wqMQJK1eE3DAL6dS6VeFIBpZIzjAQBBJSowXcIBPTtXiI5AkrU4DsEAvp2L5EcASVq8B0CASfpnktSBBAwRYb1SQgg4CSYuSRFAAFTZFifhAACToKZS1IEEDBFhvVJCCDgJJh9LxlKjoBDhHhelAACFsXL4UMEEHCIEM+LEkDAong5fIgAAg4R4nlRAghYFC+HDxHoV8Ch5DyXIICAEjX4DoGAvt1LJEdAiRp8h0BA3+4lkiOgRA2+QyBgf903lQgBm6qrv2ERsL9Om0qEgE3V1d+wCNhfp00lQsCm6upvWATsr9OmEv1XAZtKzrASBBBQogbfIRDQt3uJ5AgoUYPvEAjo271EcgSUqMF3CARMdH93dxdXV1fx+vqaeOPnMr8XJYCACXI7Ozvx/Pwc5+fnsbm5GZeXl19Cfn5+JnawvAgBBExQW1tbi7Ozs/j4+Ij19fV4enqKh4eHODo6it3d3bi5uYnr6+vEbpbHEkDAsaR+vLe09I1teXn5xyo/FyHwTXKRnZ3veX9///q3u7q6Gm9vb7G9vR17e3txe3sb9/f3cXh4GAcHB51TKB8PAROMHx8fY2trKy4uLuLl5SVOT0/j+Pg4VlZWEjtYXoQAAiao7e/vx8nJSWxsbCTeYPkPgdw/BMwlyP4sAgiYhY/NuQQQMJcg+7MIIGAWPjbnEkDAXILszyKAgFn42JxLoF0Bc5OzX4IAAkrU4DsEAvp2L5EcASVq8B0CAX27l0iOgBI1+A6BgO1139XECNhVne2FQcD2OutqYgTsqs72wiBge511NTECdlVne2EQsL3Oupr4nwTsKjlhJAggoEQNvkMgoG/3EskRUKIG3yEQ0Ld7ieQIKFGD7xAIOKp7XipFAAFLkeXcUQQQcBQmXipFAAFLkeXcUQQQcBQmXipFAAFLkeXcUQQQcBQm35dKJ0fA0oQ5fy4BBJyLh4elCSBgacKcP5cAAs7Fw8PSBBCwNGHOn0sAAefi4WFpAroClk7O+RIEEFCiBt8hENC3e4nkCChRg+8QCOjbvURyBJSowXcIBNTr3moiBLSqWy8sAup1YjURAlrVrRcWAfU6sZoIAa3q1guLgHqdWE30l4BWyQkrQQABJWrwHQIBfbuXSI6AEjX4DoGAvt1LJP8NAAD//xndqVEAAAAGSURBVAMAXMi6j8soxA8AAAAASUVORK5CYII=</thumbnail><scenes select="1"><scene name="Calculator using only Snap! blocks"><notes>I made a calculator using only Snap! blocks.</notes><palette><category name="JSON tools" color="64,0,128,1"/><category name="Calculator tools" color="128,0,128,1"/></palette><hidden></hidden><headers></headers><code></code><blocks><block-definition s="code %&apos;code&apos;" type="reporter" category="operators"><header></header><code></code><translations></translations><inputs><input type="%code" initial="1"></input></inputs><script><block s="doReport"><block var="code"/></block></script></block-definition><block-definition s="key: %&apos;key&apos; value: %&apos;value&apos;" type="reporter" category="JSON tools"><header></header><code></code><translations></translations><inputs><input type="%txt" initial="1"></input><input type="%s" initial="1"></input></inputs><script><block s="doReport"><block s="reportNewList"><list><block var="key"/><block var="value"/></list></block></block></script></block-definition><block-definition s="get value of %&apos;json&apos; with key: %&apos;key&apos;" type="reporter" category="JSON tools"><header></header><code></code><translations></translations><inputs><input type="%l" initial="1"></input><input type="%txt" initial="1"></input></inputs><script><block s="doWarp"><script><custom-block s="safely try %cs then if %upvar %cs"><script><block s="doReport"><block s="reportListItem"><l>2</l><block s="reportFindFirst"><block s="reifyPredicate"><autolambda><block s="reportVariadicEquals"><list><block s="reportListItem"><l>1</l><l/></block><block var="key"/></list></block></autolambda><list></list></block><block var="json"/></block></block></block></script><l>error</l><script><block s="doReport"><custom-block s="blank"></custom-block></block></script></custom-block></script></block></script></block-definition><block-definition s="append %&apos;json input&apos; to %&apos;json&apos;" type="command" category="JSON tools"><header></header><code></code><translations></translations><inputs><input type="%l" initial="1"></input><input type="%l" initial="1"></input></inputs><script><block s="doForEach"><l>key-value pairs</l><block var="json input"/><script><block s="doAddToList"><block var="key-value pairs"/><block var="json"/></block></script></block></script></block-definition><block-definition s="remove key %&apos;key&apos; in %&apos;json&apos;" type="command" category="JSON tools"><header></header><code></code><translations></translations><inputs><input type="%txt" initial="1"></input><input type="%l" initial="1"></input></inputs><script><block s="doWarp"><script><custom-block s="safely try %cs then if %upvar %cs"><script><block s="doDeleteFromList"><block s="reportListIndex"><block s="reportBoolean"><l><bool>true</bool></l></block><block s="reportMap"><block s="reifyReporter"><autolambda><block s="reportVariadicEquals"><list><block s="reportListItem"><l>1</l><l/></block><block var="key"/></list></block></autolambda><list></list></block><block var="json"/></block></block><block var="json"/></block></script><l>error</l><script></script></custom-block></script></block></script></block-definition><block-definition s="replace %&apos;key&apos; of %&apos;json&apos; with %&apos;value&apos;" type="command" category="JSON tools"><header></header><code></code><translations></translations><inputs><input type="%txt" initial="1"></input><input type="%l" initial="1"></input><input type="%s" initial="1"></input></inputs><script><block s="doWarp"><script><custom-block s="safely try %cs then if %upvar %cs"><script><block s="doReplaceInList"><l>2</l><block s="reportListItem"><block s="reportListIndex"><block s="reportBoolean"><l><bool>true</bool></l></block><block s="reportMap"><block s="reifyReporter"><autolambda><block s="reportVariadicEquals"><list><block s="reportListItem"><l>1</l><l/></block><block var="key"/></list></block></autolambda><list></list></block><block var="json"/></block></block><block var="json"/></block><block var="value"/></block></script><l>error</l><script></script></custom-block></script></block></script></block-definition><block-definition s="blank" type="reporter" category="operators"><header></header><code></code><translations></translations><inputs></inputs><script><block s="doReport"><l></l></block></script></block-definition><block-definition s="reset regex library" type="command" category="Calculator tools"><header></header><code></code><translations></translations><inputs></inputs><script><block s="doSetVar"><l>regex library</l><block s="reportNewList"><list><custom-block s="key: %txt value: %s"><l>alphabet contains letter</l><block s="reifyPredicate"><autolambda><block s="reportListContainsItem"><block s="reportUnicodeAsLetter"><block s="reportVariadicSum"><list><block s="reportUnicode"><block var="letter to convert to index"/></block><block s="reportNumbers"><l>0</l><l>25</l></block></list></block></block><block var="letter to match"/></block></autolambda><list><l>letter to match</l><l>letter to convert to index</l></list></block></custom-block><custom-block s="key: %txt value: %s"><l>matches letter</l><block s="reifyPredicate"><script><block s="doDeclareVariables"><list><l>alphabet contains letter par</l></list></block><block s="doSetVar"><l>alphabet contains letter par</l><custom-block s="get value of %l with key: %txt"><block var="regex library"/><l>alphabet contains letter</l></custom-block></block><block s="doReport"><block s="reportVariadicOr"><list><block s="evaluate"><block var="alphabet contains letter par"/><list><block var="letter to match"/><l>A</l></list></block><block s="evaluate"><block var="alphabet contains letter par"/><list><block var="letter to match"/><l>a</l></list></block><block s="reportVariadicEquals"><list><block var="letter to match"/><l>_</l></list></block><block s="reportVariadicAnd"><list><block var="flag"/><block s="reportIsA"><block var="letter to match"/><l><option>number</option></l></block></list></block></list></block></block></script><list><l>letter to match</l><l>flag</l></list></block></custom-block></list></block></block></script></block-definition><block-definition s="reset tokenizer" type="command" category="Calculator tools"><header></header><code></code><translations></translations><inputs></inputs><script><block s="doSetVar"><l>tokenizer</l><block s="reportNewList"><list><custom-block s="key: %txt value: %s"><l>number checker</l><block s="reifyPredicate"><autolambda><block s="reportVariadicOr"><list><block s="reportIsA"><l></l><l><option>number</option></l></block><block s="reportVariadicEquals"><list><l></l><l>-</l></list></block></list></block></autolambda><list></list></block></custom-block><custom-block s="key: %txt value: %s"><l>letter checker</l><block s="reifyPredicate"><script><block s="doDeclareVariables"><list><l>matches letter par</l></list></block><block s="doSetVar"><l>matches letter par</l><custom-block s="get value of %l with key: %txt"><block var="regex library"/><l>matches letter</l></custom-block></block><block s="doReport"><block s="reportVariadicAnd"><list><block s="evaluate"><block var="matches letter par"/><list><block s="reportLetter"><l>1</l><block var="token to check"/></block><block s="reportBoolean"><l><bool>false</bool></l></block></list></block><block s="reportVariadicAnd"><block s="reportMap"><block s="reifyReporter"><autolambda><block s="evaluate"><block var="matches letter par"/><list><l></l><block s="reportBoolean"><l><bool>true</bool></l></block></list></block></autolambda><list></list></block><block s="reportCDR"><block s="reportTextSplit"><block var="token to check"/><l><option>letter</option></l></block></block></block></block></list></block></block></script><list><l>token to check</l></list></block></custom-block><custom-block s="key: %txt value: %s"><l>tokenize</l><block s="reifyScript"><script><block s="doDeclareVariables"><list><l>character index par</l><l>processing token name par</l><l>tokenized result par</l></list></block><block s="doWarp"><script><block s="doSetVar"><l>character index par</l><l>1</l></block><block s="doSetVar"><l>processing token name par</l><custom-block s="blank"></custom-block></block><block s="doSetVar"><l>tokenized result par</l><block s="reportNewList"><list></list></block></block><block s="doDeclareVariables"><list><l>continue repeating</l></list></block><block s="doSetVar"><l>continue repeating</l><block s="reportBoolean"><l><bool>false</bool></l></block></block><block s="doUntil"><block s="reportVariadicGreaterThan"><list><block var="character index par"/><block s="reportTextAttribute"><l><option>length</option></l><block var="expression string par"/></block></list></block><script><block s="doSetVar"><l>continue repeating</l><block s="reportBoolean"><l><bool>false</bool></l></block></block><block s="doDeclareVariables"><list><l>character by index par</l></list></block><block s="doSetVar"><l>character by index par</l><block s="reportLetter"><block var="character index par"/><block var="expression string par"/></block></block><block s="doIf"><block s="reportVariadicOr"><list><block s="reportVariadicEquals"><list><block var="character by index par"/><l> </l></list></block><block s="reportVariadicEquals"><list><block var="character by index par"/><custom-block s="code %code"><l>&#xD;</l></custom-block></list></block></list></block><script><block s="doChangeVar"><l>character index par</l><l>1</l></block><block s="doSetVar"><l>continue repeating</l><block s="reportBoolean"><l><bool>true</bool></l></block></block></script><list></list></block><block s="doIf"><block s="reportNot"><block var="continue repeating"/></block><script><block s="doIf"><block s="reportIsA"><block var="character by index par"/><l><option>number</option></l></block><script><block s="doIf"><block s="reportVariadicAnd"><list><block s="reportNot"><block s="reportVariadicOr"><list><block s="evaluate"><custom-block s="get value of %l with key: %txt"><block var="tokenizer"/><l>number checker</l></custom-block><list><block var="processing token name par"/></list></block><block s="evaluate"><custom-block s="get value of %l with key: %txt"><block var="tokenizer"/><l>letter checker</l></custom-block><list><block var="processing token name par"/></list></block><block s="reportVariadicEquals"><list><block var="processing token name par"/><l>-</l></list></block></list></block></block><block s="reportNot"><block s="reportVariadicEquals"><list><block var="processing token name par"/><custom-block s="blank"></custom-block></list></block></block></list></block><script><block s="doAddToList"><block var="processing token name par"/><block var="tokenized result par"/></block><block s="doSetVar"><l>processing token name par</l><custom-block s="blank"></custom-block></block></script><list></list></block><block s="doSetVar"><l>processing token name par</l><block s="reportJoinWords"><list><block var="processing token name par"/><block var="character by index par"/></list></block></block></script><list><block s="reportVariadicOr"><list><block s="reportVariadicEquals"><list><block var="character by index par"/><l>.</l></list></block><block s="reportVariadicAnd"><list><block s="reportVariadicEquals"><list><block var="character by index par"/><l>-</l></list></block><block s="reportVariadicEquals"><list><block var="processing token name par"/><custom-block s="blank"></custom-block></list></block><block s="reportVariadicOr"><list><block s="reportListContainsItem"><block s="reportNewList"><list><l>+</l><l>-</l><l>*</l><l>/</l><l>^</l><l>(</l></list></block><block s="reportListItem"><l><option>last</option></l><block var="tokenized result par"/></block></block><block s="reportVariadicEquals"><list><block s="reportListAttribute"><l><option>length</option></l><block var="tokenized result par"/></block><l>0</l></list></block></list></block></list></block></list></block><script><block s="doIf"><block s="reportVariadicAnd"><list><block s="reportNot"><block s="reportVariadicAnd"><block s="reportMap"><block s="reifyReporter"><autolambda><block s="reportIsA"><l></l><l><option>number</option></l></block></autolambda><list></list></block><block s="reportTextSplit"><block var="processing token name par"/><l><option>letter</option></l></block></block></block></block><block s="reportNot"><block s="reportVariadicEquals"><list><block var="processing token name par"/><custom-block s="blank"></custom-block></list></block></block></list></block><script><block s="doAddToList"><block var="processing token name par"/><block var="tokenized result par"/></block><block s="doSetVar"><l>processing token name par</l><custom-block s="blank"></custom-block></block></script><list></list></block><block s="doSetVar"><l>processing token name par</l><block s="reportJoinWords"><list><block var="processing token name par"/><block var="character by index par"/></list></block></block></script><block s="evaluate"><custom-block s="get value of %l with key: %txt"><block var="tokenizer"/><l>letter checker</l></custom-block><list><block var="character by index par"/><block s="reportBoolean"><l><bool>false</bool></l></block></list></block><script><block s="doIf"><block s="reportVariadicAnd"><list><block s="reportNot"><block s="evaluate"><custom-block s="get value of %l with key: %txt"><block var="tokenizer"/><l>letter checker</l></custom-block><list><block var="processing token name par"/></list></block></block><block s="reportNot"><block s="reportVariadicEquals"><list><block var="processing token name par"/><custom-block s="blank"></custom-block></list></block></block></list></block><script><block s="doAddToList"><block var="processing token name par"/><block var="tokenized result par"/></block><block s="doSetVar"><l>processing token name par</l><custom-block s="blank"></custom-block></block></script><list></list></block><block s="doSetVar"><l>processing token name par</l><block s="reportJoinWords"><list><block var="processing token name par"/><block var="character by index par"/></list></block></block></script><l><bool>true</bool></l><script><block s="doIf"><block s="reportNot"><block s="reportVariadicEquals"><list><block var="processing token name par"/><custom-block s="blank"></custom-block></list></block></block><script><block s="doAddToList"><block var="processing token name par"/><block var="tokenized result par"/></block><block s="doSetVar"><l>processing token name par</l><custom-block s="blank"></custom-block></block></script><list></list></block><block s="doAddToList"><block var="character by index par"/><block var="tokenized result par"/></block></script></list></block><block s="doChangeVar"><l>character index par</l><l>1</l></block></script><list></list></block></script></block><block s="doIf"><block s="reportNot"><block s="reportVariadicEquals"><list><block var="processing token name par"/><custom-block s="blank"></custom-block></list></block></block><script><block s="doAddToList"><block var="processing token name par"/><block var="tokenized result par"/></block></script><list></list></block><block s="doReport"><block var="tokenized result par"/></block></script></block></script><list><l>expression string par</l></list></block></custom-block></list></block></block></script></block-definition><block-definition s="--- JSON Blocks ---" type="reporter" category="JSON tools"><header></header><code></code><translations></translations><inputs></inputs><script><block s="doReport"><block s="reportNewList"><list><block s="reifyReporter"><autolambda><custom-block s="key: %txt value: %s"><l></l><l></l></custom-block></autolambda><list></list></block><block s="reifyReporter"><autolambda><custom-block s="get value of %l with key: %txt"><l/><l></l></custom-block></autolambda><list></list></block><block s="reifyReporter"><script><custom-block s="append %l to %l"><l/><l/></custom-block></script><list></list></block><block s="reifyReporter"><script><custom-block s="remove key %txt in %l"><l></l><l/></custom-block></script><list></list></block><block s="reifyReporter"><script><custom-block s="replace %txt of %l with %s"><l></l><l/><l></l></custom-block></script><list></list></block></list></block></block></script></block-definition><block-definition s="reset lexer, tokens: %&apos;tokens&apos;" type="command" category="Calculator tools"><header></header><code></code><translations></translations><inputs><input type="%l" initial="1"></input></inputs><script><block s="doSetVar"><l>lexer</l><block s="reportNewList"><list><custom-block s="key: %txt value: %s"><l>get type of token</l><block s="reifyReporter"><script><block s="doIf"><block s="reportIsA"><block var="token par"/><l><option>number</option></l></block><script><block s="doReport"><l>number</l></block></script><list><block s="evaluate"><custom-block s="get value of %l with key: %txt"><block var="tokenizer"/><l>letter checker</l></custom-block><list><block var="token par"/></list></block><script><block s="doReport"><l>identifier</l></block></script><block s="reportVariadicEquals"><list><block var="token par"/><l>(</l></list></block><script><block s="doReport"><l>open par</l></block></script><block s="reportVariadicEquals"><list><block var="token par"/><l>)</l></list></block><script><block s="doReport"><l>close par</l></block></script><l><bool>true</bool></l><script><block s="doReport"><l>operator</l></block></script></list></block></script><list><l>token par</l></list></block></custom-block><custom-block s="key: %txt value: %s"><l>position</l><l>1</l></custom-block><custom-block s="key: %txt value: %s"><l>read next token</l><block s="reifyReporter"><script><block s="doDeclareVariables"><list><l>return value par</l></list></block><block s="doSetVar"><l>return value par</l><block s="reportListItem"><custom-block s="get value of %l with key: %txt"><block var="lexer"/><l>position</l></custom-block><custom-block s="get value of %l with key: %txt"><block var="lexer"/><l>tokens</l></custom-block></block></block><custom-block s="replace %txt of %l with %s"><l>position</l><block var="lexer"/><block s="reportVariadicSum"><list><custom-block s="get value of %l with key: %txt"><block var="lexer"/><l>position</l></custom-block><l>1</l></list></block></custom-block><block s="doReport"><block var="return value par"/></block></script><list></list></block></custom-block><custom-block s="key: %txt value: %s"><l>read current token</l><block s="reifyReporter"><script><block s="doReport"><block s="reportListItem"><custom-block s="get value of %l with key: %txt"><block var="lexer"/><l>position</l></custom-block><custom-block s="get value of %l with key: %txt"><block var="lexer"/><l>tokens</l></custom-block></block></block></script><list></list></block></custom-block></list></block></block><custom-block s="append %l to %l"><block s="reportNewList"><list><custom-block s="key: %txt value: %s"><l>tokens</l><block s="reportMap"><block s="reifyReporter"><autolambda><block s="reportNewList"><list><custom-block s="key: %txt value: %s"><l>type</l><block s="evaluate"><custom-block s="get value of %l with key: %txt"><block var="lexer"/><l>get type of token</l></custom-block><list><l></l></list></block></custom-block><custom-block s="key: %txt value: %s"><l>token</l><l></l></custom-block></list></block></autolambda><list></list></block><block var="tokens"/></block></custom-block></list></block><block var="lexer"/></custom-block></script></block-definition><block-definition s="reset parser" type="command" category="Calculator tools"><header></header><code></code><translations></translations><inputs></inputs><script><block s="doSetVar"><l>parser</l><block s="reportNewList"><list><custom-block s="key: %txt value: %s"><l>current token</l><block s="evaluate"><custom-block s="get value of %l with key: %txt"><block var="lexer"/><l>read next token</l></custom-block><list></list></block></custom-block><custom-block s="key: %txt value: %s"><l>read next token</l><block s="reifyReporter"><script><block s="doWarp"><script><block s="doDeclareVariables"><list><l>read token par</l><l>current token par</l></list></block><block s="doSetVar"><l>current token par</l><custom-block s="get value of %l with key: %txt"><block var="parser"/><l>current token</l></custom-block></block><block s="doIf"><block s="reportVariadicEquals"><list><custom-block s="get value of %l with key: %txt"><block var="current token par"/><l>type</l></custom-block><block var="expected type par"/></list></block><script><block s="doSetVar"><l>read token par</l><block var="current token par"/></block><custom-block s="replace %txt of %l with %s"><l>current token</l><block var="parser"/><block s="evaluate"><custom-block s="get value of %l with key: %txt"><block var="lexer"/><l>read next token</l></custom-block><list></list></block></custom-block><block s="doReport"><block var="read token par"/></block></script><list></list></block><block s="doStopThis"><l><option>all</option></l></block></script></block></script><list><l>expected type par</l></list></block></custom-block><custom-block s="key: %txt value: %s"><l>parse function call</l><block s="reifyReporter"><script><block s="doWarp"><script><block s="doDeclareVariables"><list><l>token read par</l><l>no use parameter</l><l>subexpression par</l></list></block><block s="doSetVar"><l>token read par</l><custom-block s="get value of %l with key: %txt"><block var="parser"/><l>current token</l></custom-block></block><block s="doIf"><block s="reportVariadicEquals"><list><custom-block s="get value of %l with key: %txt"><block var="token input par"/><l>type</l></custom-block><l>identifier</l></list></block><script><block s="doIf"><block s="reportVariadicEquals"><list><custom-block s="get value of %l with key: %txt"><block var="token read par"/><l>type</l></custom-block><l>open par</l></list></block><script><block s="doSetVar"><l>no use parameter</l><block s="evaluate"><custom-block s="get value of %l with key: %txt"><block var="parser"/><l>read next token</l></custom-block><list><l>open par</l></list></block></block><block s="doSetVar"><l>subexpression par</l><block s="evaluate"><custom-block s="get value of %l with key: %txt"><block var="parser"/><l>parse expression</l></custom-block><list></list></block></block><block s="doSetVar"><l>no use parameter</l><block s="evaluate"><custom-block s="get value of %l with key: %txt"><block var="parser"/><l>read next token</l></custom-block><list><l>close par</l></list></block></block><block s="doReport"><block s="reportNewList"><list><custom-block s="key: %txt value: %s"><l>type</l><l>function call</l></custom-block><custom-block s="key: %txt value: %s"><l>function name</l><custom-block s="get value of %l with key: %txt"><block var="token input par"/><l>name</l></custom-block></custom-block><custom-block s="key: %txt value: %s"><l>input</l><block var="subexpression par"/></custom-block></list></block></block></script><list></list></block><block s="doReport"><l></l></block></script><list></list></block><block s="doReport"><l></l></block></script></block></script><list><l>token input par</l></list></block></custom-block><custom-block s="key: %txt value: %s"><l>parse factor</l><block s="reifyReporter"><script><block s="doWarp"><script><block s="doDeclareVariables"><list><l>token read par</l><l>result par</l><l>no use parameter</l><l>subexpression par</l></list></block><block s="doSetVar"><l>token read par</l><custom-block s="get value of %l with key: %txt"><block var="parser"/><l>current token</l></custom-block></block><block s="doIf"><block s="reportVariadicEquals"><list><custom-block s="get value of %l with key: %txt"><block var="token read par"/><l>type</l></custom-block><l>number</l></list></block><script><block s="doSetVar"><l>no use parameter</l><block s="evaluate"><custom-block s="get value of %l with key: %txt"><block var="parser"/><l>read next token</l></custom-block><list><l>number</l></list></block></block><block s="doReport"><block s="reportNewList"><list><custom-block s="key: %txt value: %s"><l>type</l><l>number</l></custom-block><custom-block s="key: %txt value: %s"><l>value</l><block s="reportVariadicProduct"><list><custom-block s="get value of %l with key: %txt"><block var="token read par"/><l>token</l></custom-block><l>1</l></list></block></custom-block></list></block></block></script><list><block s="reportVariadicEquals"><list><custom-block s="get value of %l with key: %txt"><block var="token read par"/><l>type</l></custom-block><l>identifier</l></list></block><script><block s="doSetVar"><l>no use parameter</l><block s="evaluate"><custom-block s="get value of %l with key: %txt"><block var="parser"/><l>read next token</l></custom-block><list><l>identifier</l></list></block></block><block s="doSetVar"><l>result par</l><block s="reportNewList"><list><custom-block s="key: %txt value: %s"><l>type</l><l>identifier</l></custom-block><custom-block s="key: %txt value: %s"><l>name</l><custom-block s="get value of %l with key: %txt"><block var="token read par"/><l>token</l></custom-block></custom-block></list></block></block><block s="doSetVar"><l>token read par</l><custom-block s="get value of %l with key: %txt"><block var="parser"/><l>current token</l></custom-block></block><block s="doIf"><block s="reportNot"><block s="reportVariadicEquals"><list><block var="token read par"/><custom-block s="blank"></custom-block></list></block></block><script><block s="doIf"><block s="reportVariadicEquals"><list><custom-block s="get value of %l with key: %txt"><block var="token read par"/><l>type</l></custom-block><l>open par</l></list></block><script><block s="doSetVar"><l>result par</l><block s="evaluate"><custom-block s="get value of %l with key: %txt"><block var="parser"/><l>parse function call</l></custom-block><list><block var="result par"/></list></block></block></script><list></list></block></script><list></list></block><block s="doReport"><block var="result par"/></block></script><block s="reportVariadicEquals"><list><custom-block s="get value of %l with key: %txt"><block var="token read par"/><l>type</l></custom-block><l>open par</l></list></block><script><block s="doSetVar"><l>no use parameter</l><block s="evaluate"><custom-block s="get value of %l with key: %txt"><block var="parser"/><l>read next token</l></custom-block><list><l>open par</l></list></block></block><block s="doSetVar"><l>subexpression par</l><block s="evaluate"><custom-block s="get value of %l with key: %txt"><block var="parser"/><l>parse expression</l></custom-block><list></list></block></block><block s="doSetVar"><l>no use parameter</l><block s="evaluate"><custom-block s="get value of %l with key: %txt"><block var="parser"/><l>read next token</l></custom-block><list><l>close par</l></list></block></block><block s="doReport"><block var="subexpression par"/></block></script></list></block></script></block></script><list></list></block></custom-block><custom-block s="key: %txt value: %s"><l>parse exponent</l><block s="reifyReporter"><script><block s="doWarp"><script><block s="doDeclareVariables"><list><l>result par</l><l>operator par</l><l>next tokens par</l><l>no use parameter</l></list></block><block s="doSetVar"><l>result par</l><block s="evaluate"><custom-block s="get value of %l with key: %txt"><block var="parser"/><l>parse factor</l></custom-block><list></list></block></block><block s="doUntil"><block s="reportNot"><block s="reportVariadicEquals"><list><custom-block s="get json property %l ?. %txt"><custom-block s="get value of %l with key: %txt"><block var="parser"/><l>current token</l></custom-block><l>token</l></custom-block><l>^</l></list></block></block><script><block s="doSetVar"><l>operator par</l><custom-block s="get value of %l with key: %txt"><block var="parser"/><l>current token</l></custom-block></block><block s="doSetVar"><l>no use parameter</l><block s="evaluate"><custom-block s="get value of %l with key: %txt"><block var="parser"/><l>read next token</l></custom-block><list><l>operator</l></list></block></block><block s="doSetVar"><l>next tokens par</l><block s="evaluate"><custom-block s="get value of %l with key: %txt"><block var="parser"/><l>parse factor</l></custom-block><list></list></block></block><block s="doSetVar"><l>result par</l><block s="reportNewList"><list><custom-block s="key: %txt value: %s"><l>type</l><l>operation</l></custom-block><custom-block s="key: %txt value: %s"><l>operator</l><custom-block s="get value of %l with key: %txt"><block var="operator par"/><l>token</l></custom-block></custom-block><custom-block s="key: %txt value: %s"><l>left</l><block var="result par"/></custom-block><custom-block s="key: %txt value: %s"><l>right</l><block var="next tokens par"/></custom-block></list></block></block></script></block><block s="doReport"><block var="result par"/></block></script></block></script><list></list></block></custom-block><custom-block s="key: %txt value: %s"><l>parse term</l><block s="reifyReporter"><script><block s="doWarp"><script><block s="doDeclareVariables"><list><l>result par</l><l>operator par</l><l>next tokens par</l><l>no use parameter</l></list></block><block s="doSetVar"><l>result par</l><block s="evaluate"><custom-block s="get value of %l with key: %txt"><block var="parser"/><l>parse exponent</l></custom-block><list></list></block></block><block s="doUntil"><block s="reportNot"><block s="reportVariadicOr"><list><block s="reportVariadicEquals"><list><custom-block s="get json property %l ?. %txt"><custom-block s="get value of %l with key: %txt"><block var="parser"/><l>current token</l></custom-block><l>token</l></custom-block><l>*</l></list></block><block s="reportVariadicEquals"><list><custom-block s="get json property %l ?. %txt"><custom-block s="get value of %l with key: %txt"><block var="parser"/><l>current token</l></custom-block><l>token</l></custom-block><l>/</l></list></block></list></block></block><script><block s="doSetVar"><l>operator par</l><custom-block s="get value of %l with key: %txt"><block var="parser"/><l>current token</l></custom-block></block><block s="doSetVar"><l>no use parameter</l><block s="evaluate"><custom-block s="get value of %l with key: %txt"><block var="parser"/><l>read next token</l></custom-block><list><l>operator</l></list></block></block><block s="doSetVar"><l>next tokens par</l><block s="evaluate"><custom-block s="get value of %l with key: %txt"><block var="parser"/><l>parse exponent</l></custom-block><list></list></block></block><block s="doSetVar"><l>result par</l><block s="reportNewList"><list><custom-block s="key: %txt value: %s"><l>type</l><l>operation</l></custom-block><custom-block s="key: %txt value: %s"><l>operator</l><custom-block s="get value of %l with key: %txt"><block var="operator par"/><l>token</l></custom-block></custom-block><custom-block s="key: %txt value: %s"><l>left</l><block var="result par"/></custom-block><custom-block s="key: %txt value: %s"><l>right</l><block var="next tokens par"/></custom-block></list></block></block></script></block><block s="doReport"><block var="result par"/></block></script></block></script><list></list></block></custom-block><custom-block s="key: %txt value: %s"><l>parse expression</l><block s="reifyReporter"><script><block s="doWarp"><script><block s="doDeclareVariables"><list><l>result par</l><l>operator par</l><l>next tokens par</l><l>no use parameter</l></list></block><block s="doSetVar"><l>result par</l><block s="evaluate"><custom-block s="get value of %l with key: %txt"><block var="parser"/><l>parse term</l></custom-block><list></list></block></block><block s="doUntil"><block s="reportNot"><block s="reportVariadicOr"><list><block s="reportVariadicEquals"><list><custom-block s="get json property %l ?. %txt"><custom-block s="get value of %l with key: %txt"><block var="parser"/><l>current token</l></custom-block><l>token</l></custom-block><l>+</l></list></block><block s="reportVariadicEquals"><list><custom-block s="get json property %l ?. %txt"><custom-block s="get value of %l with key: %txt"><block var="parser"/><l>current token</l></custom-block><l>token</l></custom-block><l>-</l></list></block></list></block></block><script><block s="doSetVar"><l>operator par</l><custom-block s="get value of %l with key: %txt"><block var="parser"/><l>current token</l></custom-block></block><block s="doSetVar"><l>no use parameter</l><block s="evaluate"><custom-block s="get value of %l with key: %txt"><block var="parser"/><l>read next token</l></custom-block><list><l>operator</l></list></block></block><block s="doSetVar"><l>next tokens par</l><block s="evaluate"><custom-block s="get value of %l with key: %txt"><block var="parser"/><l>parse term</l></custom-block><list></list></block></block><block s="doSetVar"><l>result par</l><block s="reportNewList"><list><custom-block s="key: %txt value: %s"><l>type</l><l>operation</l></custom-block><custom-block s="key: %txt value: %s"><l>operator</l><custom-block s="get value of %l with key: %txt"><block var="operator par"/><l>token</l></custom-block></custom-block><custom-block s="key: %txt value: %s"><l>left</l><block var="result par"/></custom-block><custom-block s="key: %txt value: %s"><l>right</l><block var="next tokens par"/></custom-block></list></block></block></script></block><block s="doReport"><block var="result par"/></block></script></block></script><list></list></block></custom-block></list></block></block></script></block-definition><block-definition s="get json property %&apos;json&apos; ?. %&apos;property&apos;" type="reporter" category="operators"><header></header><code></code><translations></translations><inputs><input type="%l" initial="1"></input><input type="%txt" initial="1"></input></inputs><script><block s="doIfElse"><block s="reportNot"><block s="reportVariadicEquals"><list><block var="json"/><custom-block s="blank"></custom-block></list></block></block><script><block s="doReport"><custom-block s="get value of %l with key: %txt"><block var="json"/><block var="property"/></custom-block></block></script><script><block s="doReport"><custom-block s="blank"></custom-block></block></script></block></script></block-definition><block-definition s="reset calculator" type="command" category="Calculator tools"><header></header><code></code><translations></translations><inputs></inputs><script><block s="doSetVar"><l>calculator</l><block s="reportNewList"><list><custom-block s="key: %txt value: %s"><l>functions</l><custom-block s="function pairs %group%s%repRing"><list><l>sqrt</l><block s="reifyReporter"><autolambda><block s="reportMonadic"><l><option>sqrt</option></l><l></l></block></autolambda><list></list></block><l>cbrt</l><block s="reifyReporter"><autolambda><block s="reportPower"><l></l><block s="reportQuotient"><l>1</l><l>3</l></block></block></autolambda><list></list></block><l>sin</l><block s="reifyReporter"><autolambda><block s="reportMonadic"><l><option>sin</option></l><l></l></block></autolambda><list></list></block><l>cos</l><block s="reifyReporter"><autolambda><block s="reportMonadic"><l><option>cos</option></l><l></l></block></autolambda><list></list></block><l>tan</l><block s="reifyReporter"><autolambda><block s="reportMonadic"><l><option>tan</option></l><l></l></block></autolambda><list></list></block><l>sec</l><block s="reifyReporter"><autolambda><block s="reportQuotient"><l>1</l><block s="reportMonadic"><l><option>cos</option></l><l></l></block></block></autolambda><list></list></block><l>csc</l><block s="reifyReporter"><autolambda><block s="reportQuotient"><l>1</l><block s="reportMonadic"><l><option>sin</option></l><l></l></block></block></autolambda><list></list></block><l>cot</l><block s="reifyReporter"><autolambda><block s="reportQuotient"><l>1</l><block s="reportMonadic"><l><option>tan</option></l><l></l></block></block></autolambda><list></list></block><l>arcsin</l><block s="reifyReporter"><autolambda><block s="reportMonadic"><l><option>asin</option></l><l></l></block></autolambda><list></list></block><l>arccos</l><block s="reifyReporter"><autolambda><block s="reportMonadic"><l><option>acos</option></l><l></l></block></autolambda><list></list></block><l>arctan</l><block s="reifyReporter"><autolambda><block s="reportMonadic"><l><option>atan</option></l><l></l></block></autolambda><list></list></block><l>arcsec</l><block s="reifyReporter"><autolambda><block s="reportMonadic"><l><option>cos</option></l><block s="reportQuotient"><l>1</l><l></l></block></block></autolambda><list></list></block><l>arccsc</l><block s="reifyReporter"><autolambda><block s="reportMonadic"><l><option>asin</option></l><block s="reportQuotient"><l>1</l><l></l></block></block></autolambda><list></list></block><l>arccot</l><block s="reifyReporter"><autolambda><block s="reportMonadic"><l><option>atan</option></l><block s="reportQuotient"><l>1</l><l></l></block></block></autolambda><list></list></block><l>ln</l><block s="reifyReporter"><autolambda><block s="reportMonadic"><l><option>ln</option></l><l></l></block></autolambda><list></list></block><l>log</l><block s="reifyReporter"><autolambda><block s="reportMonadic"><l><option>log</option></l><l></l></block></autolambda><list></list></block><l>exp</l><block s="reifyReporter"><autolambda><block s="reportMonadic"><l><option>e^</option></l><l></l></block></autolambda><list></list></block><l>floor</l><block s="reifyReporter"><autolambda><block s="reportMonadic"><l><option>floor</option></l><l></l></block></autolambda><list></list></block><l>ceil</l><block s="reifyReporter"><autolambda><block s="reportMonadic"><l><option>ceiling</option></l><l></l></block></autolambda><list></list></block><l>round</l><block s="reifyReporter"><autolambda><block s="reportMonadic"><l><option>floor</option></l><block s="reportVariadicSum"><list><l></l><l>0.5</l></list></block></block></autolambda><list></list></block></list></custom-block></custom-block><custom-block s="key: %txt value: %s"><l>operator function</l><block s="reifyReporter"><script><block s="doWarp"><script><block s="doIf"><block s="reportVariadicEquals"><list><block var="operation par"/><l>+</l></list></block><script><block s="doReport"><block s="reifyReporter"><autolambda><block s="reportVariadicSum"><list><block var="left par"/><block var="right par"/></list></block></autolambda><list><l>left par</l><l>right par</l></list></block></block></script><list><block s="reportVariadicEquals"><list><block var="operation par"/><l>-</l></list></block><script><block s="doReport"><block s="reifyReporter"><autolambda><block s="reportDifference"><block var="left par"/><block var="right par"/></block></autolambda><list><l>left par</l><l>right par</l></list></block></block></script><block s="reportVariadicEquals"><list><block var="operation par"/><l>*</l></list></block><script><block s="doReport"><block s="reifyReporter"><autolambda><block s="reportVariadicProduct"><list><block var="left par"/><block var="right par"/></list></block></autolambda><list><l>left par</l><l>right par</l></list></block></block></script><block s="reportVariadicEquals"><list><block var="operation par"/><l>/</l></list></block><script><block s="doReport"><block s="reifyReporter"><autolambda><block s="reportQuotient"><block var="left par"/><block var="right par"/></block></autolambda><list><l>left par</l><l>right par</l></list></block></block></script><block s="reportVariadicEquals"><list><block var="operation par"/><l>^</l></list></block><script><block s="doReport"><block s="reifyReporter"><autolambda><block s="reportPower"><block var="left par"/><block var="right par"/></block></autolambda><list><l>left par</l><l>right par</l></list></block></block></script></list></block></script></block></script><list><l>operation par</l></list></block></custom-block><custom-block s="key: %txt value: %s"><l>calculate object</l><block s="reifyReporter"><script><block s="doWarp"><script><block s="doDeclareVariables"><list><l>self function par</l></list></block><block s="doSetVar"><l>self function par</l><custom-block s="get value of %l with key: %txt"><block var="calculator"/><l>calculate object</l></custom-block></block><block s="doIf"><block s="reportVariadicEquals"><list><custom-block s="get value of %l with key: %txt"><block var="object par"/><l>type</l></custom-block><l>number</l></list></block><script><block s="doReport"><custom-block s="get value of %l with key: %txt"><block var="object par"/><l>value</l></custom-block></block></script><list><block s="reportVariadicEquals"><list><custom-block s="get value of %l with key: %txt"><block var="object par"/><l>type</l></custom-block><l>identifier</l></list></block><script><block s="doDeclareVariables"><list><l>variable name par</l></list></block><block s="doSetVar"><l>variable name par</l><custom-block s="get value of %l with key: %txt"><block var="object par"/><l>name</l></custom-block></block><block s="doIf"><block s="reportVariadicEquals"><list><block var="variable name par"/><l>pi</l></list></block><script><block s="doReport"><l>3.141592653589793</l></block></script><list><block s="reportVariadicEquals"><list><block var="variable name par"/><l>e</l></list></block><script><block s="doReport"><block s="reportMonadic"><l><option>e^</option></l><l>1</l></block></block></script></list></block><block s="doReport"><custom-block s="get value of %l with key: %txt"><block var="variables par"/><block var="variable name par"/></custom-block></block></script><block s="reportVariadicEquals"><list><custom-block s="get value of %l with key: %txt"><block var="object par"/><l>type</l></custom-block><l>operation</l></list></block><script><block s="doReport"><block s="evaluate"><block s="evaluate"><custom-block s="get value of %l with key: %txt"><block var="calculator"/><l>operator function</l></custom-block><list><custom-block s="get value of %l with key: %txt"><block var="object par"/><l>operator</l></custom-block></list></block><list><block s="evaluate"><block var="self function par"/><list><custom-block s="get value of %l with key: %txt"><block var="object par"/><l>left</l></custom-block><block var="variables par"/></list></block><block s="evaluate"><block var="self function par"/><list><custom-block s="get value of %l with key: %txt"><block var="object par"/><l>right</l></custom-block><block var="variables par"/></list></block></list></block></block></script><block s="reportVariadicEquals"><list><custom-block s="get value of %l with key: %txt"><block var="object par"/><l>type</l></custom-block><l>function call</l></list></block><script><block s="doReport"><block s="evaluate"><custom-block s="get value of %l with key: %txt"><custom-block s="get value of %l with key: %txt"><block var="calculator"/><l>functions</l></custom-block><custom-block s="get value of %l with key: %txt"><block var="object par"/><l>function name</l></custom-block></custom-block><list><block s="evaluate"><block var="self function par"/><list><custom-block s="get value of %l with key: %txt"><block var="object par"/><l>input</l></custom-block><block var="variables par"/></list></block></list></block></block></script></list></block><block s="doReport"><custom-block s="blank"></custom-block></block></script></block></script><list><l>object par</l><l>variables par</l></list></block></custom-block><custom-block s="key: %txt value: %s"><l>tokenize</l><block s="reifyReporter"><autolambda><block s="evaluate"><custom-block s="get value of %l with key: %txt"><block var="tokenizer"/><l>tokenize</l></custom-block><list><block var="expression par"/></list></block></autolambda><list><l>expression par</l></list></block></custom-block><custom-block s="key: %txt value: %s"><l>parse</l><block s="reifyReporter"><script><block s="doWarp"><script><custom-block s="reset lexer, tokens: %l"><block var="tokens par"/></custom-block><custom-block s="reset parser"></custom-block><block s="doReport"><block s="evaluate"><custom-block s="get value of %l with key: %txt"><block var="parser"/><l>parse expression</l></custom-block><list></list></block></block></script></block></script><list><l>tokens par</l></list></block></custom-block><custom-block s="key: %txt value: %s"><l>calculate</l><block s="reifyReporter"><script><block s="doWarp"><script><block s="doDeclareVariables"><list><l>parsed par</l></list></block><block s="doSetVar"><l>parsed par</l><block s="evaluate"><custom-block s="get value of %l with key: %txt"><block var="calculator"/><l>parse</l></custom-block><list><block s="evaluate"><custom-block s="get value of %l with key: %txt"><block var="calculator"/><l>tokenize</l></custom-block><list><block var="expression par"/></list></block></list></block></block><block s="doReport"><block s="evaluate"><custom-block s="get value of %l with key: %txt"><block var="calculator"/><l>calculate object</l></custom-block><list><block var="parsed par"/><block var="variables par"/></list></block></block></script></block></script><list><l>expression par</l><l>variables par</l></list></block></custom-block></list></block></block></script></block-definition><block-definition s="function pairs %&apos;function pairs&apos;" type="reporter" category="Calculator tools"><header></header><code></code><translations></translations><inputs><input type="%group%s%repRing" expand="$nl&#xD;:" initial="2" min="2">function name</input></inputs><script><block s="doReport"><block var="function pairs"/></block></script></block-definition><block-definition s="calculate %&apos;expression&apos; %&apos;variables&apos;" type="reporter" category="Calculator tools"><header></header><code></code><translations></translations><inputs><input type="%txt" initial="1"></input><input type="%group%s" expand="variables:" max="1"></input></inputs><script><block s="doDeclareVariables"><list><l>calculate par</l></list></block><block s="doSetVar"><l>calculate par</l><custom-block s="get value of %l with key: %txt"><block var="calculator"/><l>calculate</l></custom-block></block><block s="doIfElse"><block s="reportVariadicEquals"><list><block s="reportListAttribute"><l><option>length</option></l><block var="variables"/></block><l>0</l></list></block><script><block s="doReport"><block s="evaluate"><block var="calculate par"/><list><block var="expression"/><block s="reportNewList"><list></list></block></list></block></block></script><script><block s="doReport"><block s="evaluate"><block var="calculate par"/><list><block var="expression"/><custom-block s="variable definitions %s"><block s="reportListItem"><l>1</l><block var="variables"/></block></custom-block></list></block></block></script></block></script></block-definition><block-definition s="safely try %&apos;action&apos; then if %&apos;error&apos; %&apos;handler&apos;" type="command" category="control"><comment x="0" y="0" w="276" collapsed="false">Catch errors.&#xD;&#xD;Runs the first script.  If it succeeds, nothing else happens.&#xD;But if it has an error (something that would otherwise result&#xD;in a red halo around the block), then the second script is run,&#xD;with the text of the error message that would have been shown in the variable ERROR.</comment><header></header><code></code><translations>pt:tenta executar _ e, em caso de erro _ , executa _&#xD;ca:prova de forma segura _ i si _ _&#xD;pl:bezpiecznie spróbuj _ a jeśli _ _&#xD;</translations><inputs><input type="%cs"></input><input type="%upvar"></input><input type="%cs"></input></inputs><script><block s="doApplyExtension"><l>err_try(cmd, catch, err)</l><list><block var="action"/><block var="handler"/><block var="error"/></list></block><block s="doApplyExtension"><l>err_reset</l><list></list></block></script></block-definition><block-definition s="error %&apos;msg&apos;" type="command" category="control"><comment x="0" y="0" w="268.6666666666667" collapsed="false">Throw an error.&#xD;&#xD;Makes a red halo appear around the script that runs it,&#xD;with the input text shown in a speech balloon next to&#xD;the script, just like any Snap! error.&#xD;&#xD;This is useful to put in the second script of SAFELY TRY&#xD;after some other instructions to undo the partial work of&#xD;the first script.</comment><header></header><code></code><translations>pt:lança o erro _&#xD;pl:błąd _&#xD;</translations><inputs><input type="%txt"></input></inputs><script><block s="doApplyExtension"><l>err_error(msg)</l><list><block var="msg"/></list></block></script></block-definition><block-definition s="safely try reporting %&apos;this&apos; then if %&apos;error&apos; report %&apos;that&apos;" type="reporter" category="control"><comment x="0" y="0" w="316.6666666666667" collapsed="false">Catch errors in a reporter.&#xD;&#xD;Evaluates its first input.  If that expression successfully reports a value, this block reports that value.  If the expression causes a Snap! error,&#xD;then the final input slot is evaluated with the text of what would have&#xD;been the error message in variable ERROR.  SAFELY TRY then reports the value of that final expression.&#xD;&#xD;Sometimes you&apos;ll want to throw an error in the final expression.  You&#xD;can put an ERROR block inside a CALL block to do that.</comment><header></header><code></code><translations>ca:prova de forma segura reportant _ i si _ reportant _&#xD;pl:bezpiecznie spróbuj zgłosić _ a jeśli _ zgłoś _&#xD;</translations><inputs><input type="%anyUE"></input><input type="%upvar"></input><input type="%anyUE"></input></inputs><script><block s="doDeclareVariables"><list><l>value</l></list></block><custom-block s="safely try %cs then if %upvar %cs"><script><block s="doSetVar"><l>value</l><block s="evaluate"><block var="this"/><list></list></block></block></script><l>err</l><script><block s="doSetVar"><l>error</l><block var="err"/></block><block s="doSetVar"><l>value</l><block s="evaluate"><block var="that"/><list></list></block></block></script></custom-block><block s="doReport"><block var="value"/></block></script></block-definition><block-definition s="Please use this code before evaluating in the first time." type="command" category="Calculator tools"><header></header><code></code><translations></translations><inputs></inputs><script><custom-block s="reset regex library"></custom-block><custom-block s="reset tokenizer"></custom-block><custom-block s="reset calculator"></custom-block></script></block-definition><block-definition s="$reset-1-255-0-0 $all-1-255-0-0" type="command" category="Calculator tools"><header></header><code></code><translations></translations><inputs></inputs><script><block s="doSetVar"><l>calculator</l><l>(reset)</l></block><block s="doSetVar"><l>lexer</l><l>(reset)</l></block><block s="doSetVar"><l>parser</l><l>(reset)</l></block><block s="doSetVar"><l>regex library</l><l>(reset)</l></block><block s="doSetVar"><l>tokenizer</l><l>(reset)</l></block></script></block-definition><block-definition s="variable definitions %&apos;variable definitions&apos;" type="reporter" category="Calculator tools"><header></header><code></code><translations></translations><inputs><input type="%s" initial="1"></input></inputs><script><block s="doWarp"><script><block s="doDeclareVariables"><list><l>result</l></list></block><block s="doSetVar"><l>result</l><block s="reportMap"><block s="reifyReporter"><autolambda><block s="reportTextSplit"><l></l><l>=</l></block></autolambda><list></list></block><block s="reportTextSplit"><block var="variable definitions"/><l>,</l></block></block></block><block s="doFor"><l>i</l><l>1</l><block s="reportListAttribute"><l><option>length</option></l><block var="result"/></block><script><block s="doReplaceInList"><l>2</l><block s="reportListItem"><block var="i"/><block var="result"/></block><custom-block s="calculate %txt %group%s"><block s="reportListItem"><l>2</l><block s="reportListItem"><block var="i"/><block var="result"/></block></block><list></list></custom-block></block></script></block><block s="doReport"><block var="result"/></block></script></block></script></block-definition></blocks><primitives></primitives><stage name="Stage" width="480" height="360" costume="0" color="255,255,255,1" tempo="60" threadsafe="false" penlog="false" volume="100" pan="0" lines="round" ternary="false" hyperops="true" codify="false" inheritance="true" sublistIDs="false" id="2495"><pentrails>data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAeAAAAFoCAYAAACPNyggAAAQAElEQVR4AezVC27kNhAEUCP3P3SC/NZeez6SSDWb9YJg1zsjkV2vDdQfH/4jQIAAAQIEbhdQwLeTu5AAAQIECHx8ZBew3wACBAgQIFAkoICL4F1LgAABAtkCCjh3/5ITIECAQKGAAi7EdzUBAgQI5Aoo4NzdZyeXngABAsUCCr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kXiBAgAABAtcFOhfw9fROIECAAAECRQIKuAjetQQIECCQLaCAu+7f3AQIECDQWkABt16f4QkQIECgq4AC7rq57LmlJ0CAQHsBBdx+hQIQIECAQEcBBdxxa2bOFpCeAIEtBBTwFmsUggABAgS6CSjgbhszL4FsAekJbCOggLdZpSAECBAg0ElAAXfallkJEMgWkH4rAQW81TqFIUCAAIEuAgq4y6bMSYAAgWyB7dIr4O1WKhABAgQIdBBQwB22ZEYCBAgQ2E7gUAFvl14gAgQIECBQJKCAi+BdS4AAAQLZAgr47f17kAABAgQIjBNQwOMsnUSAAAECBN4WUMBvU2U/KD0BAgQIjBVQwGM9nUaAAAECBN4SUMBvMXkoW0B6AgQIjBdQwONNnUiAAAECBF4KKOCXRB4gkC0gPQECcwQU8BxXpxIgQIAAgacCCvgpjy8JEMgWkJ7APAEFPM/WyQQIECBA4KGAAn5I4wsCBAhkC0g/V0ABz/V1OgECBAgQ+FFAAf/I4kMCBAgQyBaYn14Bzzd2AwECBAgQ+CaggL+R+IAAAQIECMwXWLmA56d3AwECBAgQKBJQwEXwriVAgACBbAEFvOr+zUWAAAECWwso4K3XKxwBAgQIrCrwJwAAAP//lVwoVAAAAAZJREFUAwDU5ALRcl29HAAAAABJRU5ErkJggg==</pentrails><costumes><list struct="atomic" id="2496"></list></costumes><sounds><list struct="atomic" id="2497"></list></sounds><variables></variables><blocks></blocks><scripts></scripts><sprites select="1"><sprite name="calculator" idx="1" x="0" y="0" heading="90" scale="1" volume="100" pan="0" rotation="1" draggable="true" hidden="true" costume="0" color="80,80,80,1" pen="tip" id="2502"><costumes><list struct="atomic" id="2503"></list></costumes><sounds><list struct="atomic" id="2504"></list></sounds><blocks></blocks><variables></variables><scripts><script x="29" y="205"><block s="receiveGo"></block><block s="hide"></block><block s="gotoXY"><l>0</l><l>0</l></block></script><script x="458" y="317"><block s="bubble"><custom-block s="--- JSON Blocks ---"></custom-block></block></script><script x="148" y="418"><custom-block s="Please use this code before evaluating in the first time."></custom-block><block s="bubble"><custom-block s="calculate %txt %group%s"><l>round(sin(30)*2)</l><list></list></custom-block></block></script><script x="279" y="541"><custom-block s="$reset-1-255-0-0 $all-1-255-0-0"></custom-block></script><script x="20" y="10"><block s="receiveGo"></block><block s="gotoXY"><l>0</l><l>0</l></block><block s="hide"></block></script></scripts></sprite><sprite name="json blocks" idx="2" x="0" y="0" heading="90" scale="1" volume="100" pan="0" rotation="1" draggable="true" hidden="true" costume="0" color="80,80,80,1" pen="tip" id="2529"><costumes><list struct="atomic" id="2530"></list></costumes><sounds><list struct="atomic" id="2531"></list></sounds><blocks></blocks><variables></variables><scripts><script x="139" y="300"><block s="bubble"><custom-block s="--- JSON Blocks ---"></custom-block></block></script><script x="117" y="152.16666666666663"><block s="receiveGo"></block><block s="gotoXY"><l>0</l><l>0</l></block><block s="hide"></block></script></scripts></sprite><watcher var="lexer" style="normal" x="10" y="10" color="243,118,29" hidden="true"/><watcher var="parser" style="normal" x="10" y="31.000001999999995" color="243,118,29" hidden="true"/><watcher var="calculator" style="normal" x="10" y="52.00000399999999" color="243,118,29" hidden="true"/><sprite name="asker" idx="3" x="0" y="0" heading="90" scale="1" volume="100" pan="0" rotation="1" draggable="true" costume="0" color="80,80,80,1" pen="tip" id="2546"><inherit exemplar="calculator"><list struct="atomic" id="2547">costumes,sounds</list></inherit><blocks></blocks><variables></variables><dispatches></dispatches><scripts><script x="20" y="10"><block s="receiveGo"></block><block s="doDeclareVariables"><list><l>expression par</l><l>variables par</l></list></block><block s="gotoXY"><l>0</l><l>0</l></block><block s="doIf"><block s="reportNot"><block var="initialized"/></block><script><custom-block s="Please use this code before evaluating in the first time."></custom-block><block s="doSetVar"><l>initialized</l><block s="reportBoolean"><l><bool>true</bool></l></block></block></script><list></list></block><block s="doForever"><script><block s="doAsk"><l>expression to calculate?</l></block><block s="doSetVar"><l>expression par</l><block s="getLastAnswer"></block></block><block s="doAsk"><l>variable definitions?</l></block><block s="doSetVar"><l>variables par</l><block s="getLastAnswer"></block></block><block s="bubble"><block s="reportJoinWords"><list><custom-block s="calculate %txt %group%s"><block var="expression par"/><list><block var="variables par"/></list></custom-block><l> (space to proceed)</l></list></block></block><block s="doWaitUntil"><block s="reportKeyPressed"><l><option>space</option></l></block></block><block s="doWaitUntil"><block s="reportNot"><block s="reportKeyPressed"><l><option>space</option></l></block></block></block></script></block></script><script x="395" y="106.16666666666669"><custom-block s="$reset-1-255-0-0 $all-1-255-0-0"></custom-block><block s="doSetVar"><l>initialized</l><block s="reportBoolean"><l><bool>false</bool></l></block></block></script></scripts></sprite><watcher var="initialized" style="normal" x="10" y="73.00000599999998" color="243,118,29" hidden="true"/></sprites></stage><variables><variable name="regex library"><l>(reset)</l></variable><variable name="tokenizer"><l>(reset)</l></variable><variable name="lexer"><l>(reset)</l></variable><variable name="parser"><l>(reset)</l></variable><variable name="calculator"><l>(reset)</l></variable><variable name="initialized"><bool>false</bool></variable></variables></scene></scenes></project><media name="Calculator using only Snap! blocks" app="Snap! 11.0.8, https://snap.berkeley.edu" version="2"></media></snapdata>