Typeclasses

This commit is contained in:
Dustin Swan 2026-03-26 21:38:32 -06:00
parent a4daf88085
commit 8020f9d1a0
No known key found for this signature in database
GPG key ID: 30D46587E2100467
6 changed files with 123 additions and 19 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, typeDefinitions: typeDefs } = parser.parse();
const { definitions: defs, typeDefinitions: typeDefs, classDefinitions: classDefs, instanceDeclarations: instances } = parser.parse();
loadDefinitions();
// TODO remove once we're booting from store, files are backup
if (!store.paletteHistory) store.paletteHistory = [];
compileAndRun(defs, typeDefs);
compileAndRun(defs, typeDefs, classDefs, instances);
saveDefinitions();
runAppCompiled(canvas, store);