nicer looking
This commit is contained in:
parent
8abbac4bc9
commit
e850952738
14 changed files with 547 additions and 104 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import {getType, getInst, getSymbol, Double, Int, symbolFunction, symbolProduct, symbolSum, symbolDict, symbolSet, symbolList, eqType, match, getLeft, getRight, dict, Bool, set, Unit} from "dope2";
|
||||
import {getType, getInst, getSymbol, Double, Int, symbolFunction, symbolProduct, symbolSum, symbolDict, symbolSet, symbolList, eqType, match, getLeft, getRight, dict, Bool, set, Unit, symbolType, symbolUUID, getHumanReadableName} from "dope2";
|
||||
|
||||
import "./Value.css";
|
||||
import { Type } from "./Type";
|
||||
|
||||
export function Value({dynamic}) {
|
||||
const type = getType(dynamic);
|
||||
|
|
@ -32,7 +33,10 @@ export function Value({dynamic}) {
|
|||
return <ValueSet val={inst} elemType={type.params[0](type)} />;
|
||||
case symbolList:
|
||||
return <ValueList val={inst} elemType={type.params[0](type)} />;
|
||||
|
||||
case symbolType:
|
||||
return <Type type={inst}/>;
|
||||
case symbolUUID:
|
||||
return <ValueUUID val={inst}/>
|
||||
default:
|
||||
return <>don't know how to show value</>;
|
||||
}
|
||||
|
|
@ -74,3 +78,6 @@ function ValueProduct({val, leftType, rightType}) {
|
|||
function ValueUnit() {
|
||||
return <>{'()'}</>;
|
||||
}
|
||||
function ValueUUID({val}) {
|
||||
return <span className="valueUUID">{getHumanReadableName(val)}</span>;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue