{generatePrettyText(program)}
diff --git a/apps/lil-buddy/src/linting/ProgramCommand.svelte b/apps/lil-buddy/src/linting/ProgramCommand.svelte
new file mode 100644
index 0000000..57d0858
--- /dev/null
+++ b/apps/lil-buddy/src/linting/ProgramCommand.svelte
@@ -0,0 +1,90 @@
+
+
+
diff --git a/apps/lil-buddy/src/linting/VisualSummarizer.svelte b/apps/lil-buddy/src/linting/VisualSummarizer.svelte
index 4c97aae..d648d98 100644
--- a/apps/lil-buddy/src/linting/VisualSummarizer.svelte
+++ b/apps/lil-buddy/src/linting/VisualSummarizer.svelte
@@ -14,6 +14,7 @@
error = e;
}
}
+ $: console.log("summarizer");
diff --git a/apps/lil-buddy/src/linting/VisualSummaryNode.svelte b/apps/lil-buddy/src/linting/VisualSummaryNode.svelte
deleted file mode 100644
index 1fd769b..0000000
--- a/apps/lil-buddy/src/linting/VisualSummaryNode.svelte
+++ /dev/null
@@ -1,124 +0,0 @@
-
-
-
-
-{#if node.nodeType === "conjunction"}
-
-{:else if node.nodeType === "quantifier"}
-
-
{node.type} - {node.varbs}
-
-
- {#if node.input.value === "colors"}
- {#each pal.colors as color}
-
-
- {#each Object.values(inducedVariables) as innerColor}
-
- {/each}
-
-
- {#if !isQuantifierAndChildIsQuantifier}
-
Predicate
- {/if}
-
-
-
-
- {/each}
- {:else if Array.isArray(node.input.children) && typeof node.input.children?.at(0)?.constructorString}
- {#each makePalFromString(node.input.children.map((x) => x.constructorString)).colors as color}
-
-
- {#each Object.values(inducedVariables) as innerColor}
-
- {/each}
-
-
- {#if isQuantifierAndChildIsQuantifier}
-
Predicate
- {/if}
-
-
- {/each}
- {/if}
-
-
-{:else if node.nodeType === "predicate"}
-
-{:else if node.nodeType === "number"}
-
{node.value}
-{:else if node.nodeType === "variable"}
- {#if inducedVariables[node.value]}
-
- {:else}
-
{node.value}
- {/if}
-{:else if node.nodeType === "pairFunction"}
-
- {node.type}
- {"("}
-
- {","}
-
- {")"}
-
-{:else if node.type === "color"}
-
hi
-{/if}
diff --git a/apps/lil-buddy/src/linting/summary-nodes/DispatchNode.svelte b/apps/lil-buddy/src/linting/summary-nodes/DispatchNode.svelte
index e2a9fa0..0a9bc7d 100644
--- a/apps/lil-buddy/src/linting/summary-nodes/DispatchNode.svelte
+++ b/apps/lil-buddy/src/linting/summary-nodes/DispatchNode.svelte
@@ -1,32 +1,16 @@
{#if node.nodeType == "conjunction" && !isNotNode}
diff --git a/apps/lil-buddy/src/linting/summary-nodes/QuantifierNode.svelte b/apps/lil-buddy/src/linting/summary-nodes/QuantifierNode.svelte
index 5e07a92..d9606fd 100644
--- a/apps/lil-buddy/src/linting/summary-nodes/QuantifierNode.svelte
+++ b/apps/lil-buddy/src/linting/summary-nodes/QuantifierNode.svelte
@@ -1,49 +1,14 @@
@@ -66,7 +31,7 @@
- {#if checkWhere(node.where, color, node.varbs[0])}
+ {#if checkWhere(node.where, color, node.varbs[0], pal, inducedVariables)}
= {},
+ pal: Palette
+) {
+ const isNotNode = node.nodeType === "conjunction" && node.type === "not";
+ if (evalNodeTypes.has(node.nodeType) || isNotNode) {
+ try {
+ return generateEvaluations(node, inducedVariables, pal);
+ } catch (e) {
+ console.error(e);
+ }
+ }
+ return [];
+}
+
+export function checkWhere(
+ node: any,
+ color: Color,
+ varb: string,
+ pal: Palette,
+ inducedVariables: Record
+): boolean {
+ if (!node) return true;
+ const result = evaluateNode(
+ node,
+ { ...inducedVariables, [varb]: color },
+ pal
+ );
+ return result.result;
+}
+
+export function handleEval(node: any, inducedVariables: any, pal: any) {
+ try {
+ return evaluateNode(node, inducedVariables, pal);
+ } catch (e) {
+ console.error(e);
+ return { result: "error" };
+ }
+}
+
+export function getValues(node: any, pal: Palette) {
+ if (node?.input?.value === "colors") {
+ return pal.colors;
+ }
+ if (
+ Array.isArray(node?.input?.children) &&
+ typeof node.input.children?.at(0)?.constructorString
+ ) {
+ return makePalFromString(
+ node.input.children.map((x: any) => x.constructorString)
+ ).colors;
+ }
+
+ return [];
+}