greatly simplified app

This commit is contained in:
Joeri Exelmans 2025-05-13 18:29:37 +02:00
parent 9c0c2dab90
commit 35d1034c67
8 changed files with 156 additions and 204 deletions

View file

@ -1,4 +1,4 @@
import {getType, getInst, getSymbol, Double, Int, symbolFunction, symbolProduct, symbolSum, symbolDict, symbolSet, symbolList, eqType, match, getLeft, getRight, dict} from "dope2";
import {getType, getInst, getSymbol, Double, Int, symbolFunction, symbolProduct, symbolSum, symbolDict, symbolSet, symbolList, eqType, match, getLeft, getRight, dict, Bool} from "dope2";
import "./Value.css";
@ -11,6 +11,9 @@ export function Value({dynamic}) {
if (eqType(type)(Int)) {
return <ValueInt val={inst}/>;
}
if (eqType(type)(Bool)) {
return <ValueBool val={inst}/>;
}
const symbol = getSymbol(type);
switch (symbol) {
@ -48,6 +51,9 @@ function ValueInt({val}) {
function ValueFunction() {
return <>&#119891;&#119899;&nbsp;</>;
}
function ValueBool({val}) {
return <span className="valuePrimitive">{val.toString()}</span>;
}
// function Sum({val, elemType}) {
// return
// }