Adding Stack and TextInput to the UI
This commit is contained in:
parent
50bb15e974
commit
223eea72e3
6 changed files with 226 additions and 11 deletions
|
|
@ -7,6 +7,7 @@ import { builtins } from './builtins';
|
|||
|
||||
import counterApp from './counter.cg?raw';
|
||||
import stdlibCode from './stdlib.cg?raw';
|
||||
import textInputCode from './textinput-test.cg?raw';
|
||||
import testCode from './test.cg?raw';
|
||||
|
||||
const canvas = document.createElement('canvas');
|
||||
|
|
@ -14,7 +15,7 @@ canvas.width = 800;
|
|||
canvas.height = 600;
|
||||
document.body.appendChild(canvas);
|
||||
|
||||
const cgCode = stdlibCode + '\n' + testCode;
|
||||
const cgCode = stdlibCode + '\n' + textInputCode;
|
||||
|
||||
const tokens = tokenize(cgCode);
|
||||
const parser = new Parser(tokens);
|
||||
|
|
@ -22,10 +23,9 @@ const ast = parser.parse();
|
|||
console.log(ast);
|
||||
|
||||
const env: Env = new Map(Object.entries(builtins));
|
||||
const res = evaluate(ast, env);
|
||||
console.log(res);
|
||||
// const res = evaluate(ast, env);
|
||||
// console.log(res);
|
||||
|
||||
/*
|
||||
const appRecord = evaluate(ast, env);
|
||||
|
||||
console.log(appRecord);
|
||||
|
|
@ -38,4 +38,3 @@ const update = appRecord.fields.update;
|
|||
const view = appRecord.fields.view;
|
||||
|
||||
runApp({ init, update, view }, canvas);
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue