rename Editor -> ExprBlock

This commit is contained in:
Joeri Exelmans 2025-05-18 11:10:25 +02:00
parent fe83532261
commit 93f665ba8f
9 changed files with 55 additions and 56 deletions

View file

@ -1,9 +1,9 @@
import { useContext, useEffect, useRef } from "react";
import { Editor, type EditorState } from "./Editor";
import { ExprBlock, type ExprBlockState } from "./ExprBlock";
import { EnvContext } from "./EnvContext";
import { evalEditorBlock, makeInnerEnv, scoreResolved, type ResolvedType } from "./eval";
import { type State2Props } from "./Editor";
import { type State2Props } from "./ExprBlock";
import { autoInputWidth } from "./util/dom_trickery";
import { GlobalContext } from "./GlobalContext";
@ -12,11 +12,11 @@ import "./LetInBlock.css";
export interface LetInBlockState {
kind: "let";
name: string;
value: EditorState;
inner: EditorState;
value: ExprBlockState;
inner: ExprBlockState;
}
interface LetInBlockProps extends State2Props<LetInBlockState,EditorState> {}
interface LetInBlockProps extends State2Props<LetInBlockState,ExprBlockState> {}
export function LetInBlock(props: LetInBlockProps) {
return <span className="letIn">
@ -67,7 +67,7 @@ function DeclColumns({state: {name, value, inner}, setState, suggestionPriority}
</span>
<span className="keyword column">&nbsp;=&nbsp;</span>
<span className="column">
<Editor
<ExprBlock
state={value}
setState={setValue}
suggestionPriority={valueSuggestionPriority}
@ -105,7 +105,7 @@ function InnerMost({state, setState, suggestionPriority}) {
}
else {
return <EnvContext value={innerEnv}>
<Editor
<ExprBlock
state={state.inner}
setState={setInner}
suggestionPriority={suggestionPriority}