wrote interpreter (independent of type inferencer)

This commit is contained in:
Joeri Exelmans 2025-05-26 15:34:50 +02:00
parent 2279c54229
commit 32bdc23ea7
6 changed files with 104 additions and 602 deletions

View file

@ -3,7 +3,7 @@ import { useContext } from "react";
import { CallContext } from "../../context/CallContext";
import { EnvContext } from "../../context/EnvContext";
import { GlobalContext } from "../../context/GlobalContext";
import { type Environment, type TypeInfoCall } from "../../eval/infer_type";
import { type StaticEnvironment, type TypeInfoCall } from "../../eval/infer_type";
import { getActions } from "../app/actions";
import { Type } from "../other/Type";
import "./CallBlock.css";
@ -22,7 +22,7 @@ export interface CallBlockProps<
typeInfo: TypeInfoCall;
}
function nestedFnProperties({state, setState, score, typeInfo}: CallBlockProps, env: Environment) {
function nestedFnProperties({state, setState, score, typeInfo}: CallBlockProps, env: StaticEnvironment) {
const setFn = (callback: SetStateFn) => {
setState(state => ({...state, fn: callback(state.fn)}));
};
@ -35,7 +35,7 @@ function nestedFnProperties({state, setState, score, typeInfo}: CallBlockProps,
return {state: state.fn, setState: setFn, onCancel: onFnCancel, score: scoreFn, typeInfo: typeInfo.fn};
}
function nestedInputProperties({state, setState, score, typeInfo}: CallBlockProps, env: Environment) {
function nestedInputProperties({state, setState, score, typeInfo}: CallBlockProps, env: StaticEnvironment) {
const setInput = (callback: SetStateFn) => {
setState(state => ({...state, input: callback(state.input)}));
};