Merge pull request #915 from quantified-uncertainty/mitigate-void
Void bug fixes
This commit is contained in:
commit
2988b9bcb6
|
@ -59,6 +59,13 @@ export const ExpressionViewer: React.FC<Props> = ({
|
||||||
expression,
|
expression,
|
||||||
width,
|
width,
|
||||||
}) => {
|
}) => {
|
||||||
|
if (typeof expression !== "object") {
|
||||||
|
return (
|
||||||
|
<VariableList path={path} heading="Error">
|
||||||
|
{() => `Unknown expression: ${expression}`}
|
||||||
|
</VariableList>
|
||||||
|
);
|
||||||
|
}
|
||||||
switch (expression.tag) {
|
switch (expression.tag) {
|
||||||
case "number":
|
case "number":
|
||||||
return (
|
return (
|
||||||
|
@ -281,10 +288,16 @@ export const ExpressionViewer: React.FC<Props> = ({
|
||||||
);
|
);
|
||||||
default: {
|
default: {
|
||||||
return (
|
return (
|
||||||
|
<VariableList path={path} heading="Error">
|
||||||
|
{() => (
|
||||||
<div>
|
<div>
|
||||||
<span>No display for type: </span>{" "}
|
<span>No display for type: </span>{" "}
|
||||||
<span className="font-semibold text-slate-600">{expression.tag}</span>
|
<span className="font-semibold text-slate-600">
|
||||||
|
{expression.tag}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
)}
|
||||||
|
</VariableList>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,7 @@ import { tagged, tag } from "./types";
|
||||||
|
|
||||||
// Raw rescript types.
|
// Raw rescript types.
|
||||||
export type rescriptExport =
|
export type rescriptExport =
|
||||||
|
| 0 // EvVoid
|
||||||
| {
|
| {
|
||||||
TAG: 0; // EvArray
|
TAG: 0; // EvArray
|
||||||
_0: rescriptExport[];
|
_0: rescriptExport[];
|
||||||
|
@ -140,6 +141,10 @@ export function convertRawToTypescript(
|
||||||
result: rescriptExport,
|
result: rescriptExport,
|
||||||
environment: environment
|
environment: environment
|
||||||
): squiggleExpression {
|
): squiggleExpression {
|
||||||
|
if (typeof result === "number") {
|
||||||
|
// EvVoid
|
||||||
|
return tag("void", "");
|
||||||
|
}
|
||||||
switch (result.TAG) {
|
switch (result.TAG) {
|
||||||
case 0: // EvArray
|
case 0: // EvArray
|
||||||
return tag(
|
return tag(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user