Adding builtins as native-functions. desugaring symbols as native function application. except ~ which is the new pipe operator, > is now greater than
This commit is contained in:
parent
5b40e9d298
commit
216fe6bd30
7 changed files with 587 additions and 115 deletions
|
|
@ -4,6 +4,7 @@ import { tokenize } from './lexer'
|
|||
import { Parser } from './parser'
|
||||
import cgCode from './counter.cg?raw';
|
||||
import { runApp } from './runtime';
|
||||
import { builtins } from './builtins';
|
||||
|
||||
const canvas = document.createElement('canvas');
|
||||
canvas.width = 800;
|
||||
|
|
@ -15,7 +16,7 @@ const parser = new Parser(tokens);
|
|||
const ast = parser.parse();
|
||||
console.log(ast);
|
||||
|
||||
const env: Env = new Map();
|
||||
const env: Env = new Map(Object.entries(builtins));
|
||||
const appRecord = evaluate(ast, env);
|
||||
|
||||
console.log(appRecord);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue