Last active
June 27, 2019 08:53
-
-
Save matisiekpl/91b7eb77cb2ae7943b703e368fc61c11 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "functions": [ | |
| { | |
| "key": "math.add", | |
| "name": "add", | |
| "code": "out = a + b", | |
| "dependencies": { | |
| "@types/node": "^12.0.10" | |
| }, | |
| "arguments": [ | |
| { | |
| "name": "a", | |
| "schema": { | |
| "type": "int" | |
| } | |
| }, | |
| { | |
| "name": "b", | |
| "schema": { | |
| "type": "int" | |
| } | |
| } | |
| ], | |
| "results": [ | |
| { | |
| "name": "out", | |
| "schema": { | |
| "type": "int" | |
| } | |
| } | |
| ] | |
| }, | |
| { | |
| "key": "print", | |
| "name": "print", | |
| "code": "console.log(message)", | |
| "dependencies": { | |
| "@types/node": "^12.0.10" | |
| }, | |
| "arguments": [ | |
| { | |
| "name": "message", | |
| "schema": { | |
| "type": "string" | |
| } | |
| } | |
| ] | |
| }, | |
| { | |
| "key": "if", | |
| "name": "if", | |
| "code": "if(expression) when_true(); else when_false();", | |
| "dependencies": { | |
| "@types/node": "^12.0.10" | |
| }, | |
| "arguments": [ | |
| { | |
| "name": "expression", | |
| "schema": { | |
| "type": "string" | |
| } | |
| }, | |
| { | |
| "name": "when_true", | |
| "schema": { | |
| "type": "call" | |
| } | |
| }, | |
| { | |
| "name": "when_false", | |
| "schema": { | |
| "type": "call" | |
| } | |
| } | |
| ] | |
| } | |
| ], | |
| "main": [ | |
| { | |
| "function_key": "math.add", | |
| "name": "add", | |
| "arguments": [ | |
| { | |
| "name": "a", | |
| "value": 7 | |
| }, | |
| { | |
| "name": "b", | |
| "value": 5 | |
| } | |
| ], | |
| "results": [ | |
| { | |
| "name": "out", | |
| "variable": "out" | |
| } | |
| ] | |
| }, | |
| { | |
| "function_key": "if", | |
| "name": "decide", | |
| "arguments": [ | |
| { | |
| "name": "expression", | |
| "value": "out > 11" | |
| }, | |
| { | |
| "name": "when_true", | |
| "value": { | |
| "function_key": "print", | |
| "name": "print success", | |
| "arguments": [ | |
| { | |
| "name": "message", | |
| "value": "'It works! The result is equal to:' + out" | |
| } | |
| ] | |
| } | |
| }, | |
| { | |
| "name": "when_false", | |
| "value": { | |
| "function_key": "print", | |
| "name": "print error", | |
| "arguments": [ | |
| { | |
| "name": "message", | |
| "value": "'Oh, something is wrong'" | |
| } | |
| ] | |
| } | |
| } | |
| ] | |
| }, | |
| { | |
| "function_key": "print", | |
| "name": "print at the end", | |
| "arguments": [ | |
| { | |
| "name": "message", | |
| "value": "out" | |
| } | |
| ] | |
| } | |
| ] | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment