revert(802-1): 801-1 wip 옛 나무 위 고침 걷음 — 요구 664 수식 문서로 다시 짬
- 걷음: 43784a4c0 의 옛 수식 나무 위 고침(서버 · 화면 · css) = 그 앞 판으로 되돌림
- 남김: master_equation_sign.py · ui_template_equation_text.ts · ui_template_equation_edit.ts(다시 쓸 조각 · 지금 안 부름) · text 는 `입력글` 을 제 타입에
- 지움: test_801_1_equation_inline.py — 걷은 옛 나무 고침을 재는 시험
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -2,12 +2,10 @@
|
||||
* M01_MasterData/logic/M01_Logic_Equation_Model.ts
|
||||
* 수식 탭 계산(796-2 · 화면 · fetch 없음) — 줄 → 고침 자리 · 식 칸 아이콘 끼움 · 옵션 값 꼴 · 변수 고침 요청.
|
||||
* 서버 고침 꼴 = `master_equation_edit.py` 머리(할일 식 · 더함 · 지움 · 변수 · 표시) — 여기서는 요청 목록만 만듦
|
||||
* 값 숫자 고침(801 · `valueEdit`) = 입력 → 옵션 값 · 중간 → 그 줄 식 = 그 수 · 수 · 표 찾기 · 요소 → 이 줄 식의 그 자리 = 그 수
|
||||
* 셈 · 검사는 서버 한 벌(③ 서버 단독) — 브라우저는 모양만
|
||||
* ========================================================================== */
|
||||
|
||||
import type { EqLine, EqNode } from "@ui/ui_template_equation";
|
||||
import { textOf } from "@ui/ui_template_equation_text";
|
||||
import type { EqLine } from "@ui/ui_template_equation";
|
||||
|
||||
export interface EqEdit {
|
||||
할일: "식" | "더함" | "지움" | "변수" | "표시" | "연결";
|
||||
@@ -123,17 +121,3 @@ export function unknownOf(reasons: string[]): string[] {
|
||||
}
|
||||
return [];
|
||||
}
|
||||
|
||||
/** 값 식 숫자 고침 → 옵션 값(입력) | 고침 목록 | 까닭 글 */
|
||||
export function valueEdit(
|
||||
line: EqLine,
|
||||
leaf: EqNode,
|
||||
text: string,
|
||||
): { input: string } | { edits: EqEdit[] } | string {
|
||||
if (!/^-?\d+(\.\d+)?$/.test(text)) return "값은 수로 적을 것";
|
||||
if (leaf.꼴 === "변수" && leaf.갈래 === "입력") return { input: leaf.열쇠 ?? "" };
|
||||
if (leaf.꼴 === "변수" && leaf.갈래 === "중간")
|
||||
return { edits: [{ 할일: "식", 자리: `중간:${leaf.열쇠 ?? ""}`, 식: text }] };
|
||||
const tree = line.갈래 === "호표" ? line.이름식?.우 : line.이름식; // 호표 식 = 수량 쪽
|
||||
return { edits: [formulaEdit(line, textOf(tree, new Map([[leaf, text]])))] };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user