Type constructors

This commit is contained in:
Dustin Swan 2026-03-26 19:49:28 -06:00
parent 635f12490d
commit 668ee3e4d8
No known key found for this signature in database
GPG key ID: 30D46587E2100467
4 changed files with 50 additions and 17 deletions

View file

@ -23,13 +23,13 @@ store.viewport = { width: window.innerWidth, height: window.innerHeight };
try {
const tokens = tokenize(cgCode);
const parser = new Parser(tokens, cgCode);
const { definitions: defs } = parser.parse();
const { definitions: defs, typeDefinitions: typeDefs } = parser.parse();
loadDefinitions();
// TODO remove once we're booting from store, files are backup
if (!store.paletteHistory) store.paletteHistory = [];
compileAndRun(defs);
compileAndRun(defs, typeDefs);
saveDefinitions();
runAppCompiled(canvas, store);