transpiler (for future reference)
This commit is contained in:
parent
2499c4057c
commit
3b4ae44fb3
2 changed files with 58 additions and 4 deletions
|
|
@ -52,6 +52,9 @@ function curry(patterns, body, scope, ops) {
|
|||
export function run(node, scope, ops = {}) {
|
||||
let runInScope = (node, scp = scope) => run(node, scp, ops);
|
||||
//console.log("node", node.type, node.text);
|
||||
if (ops[node.type]) {
|
||||
return ops[node.type](node);
|
||||
}
|
||||
switch (node.type) {
|
||||
case 'ERROR':
|
||||
throw new Error(`invalid syntax: "${node.text}"`);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue