fix(est): parse approximate value annotations

This commit is contained in:
2026-11-06 22:59:17 +09:00
parent ed2d95745e
commit a138efa5f4
3 changed files with 15 additions and 1 deletions
+13
View File
@@ -314,6 +314,19 @@ def test_parenthesized_variable_label_assigns_explicit_value():
assert result["rows"][2]["TC"] == 20
def test_variable_assignment_with_approximate_annotation():
result = run(
"math",
r"""EstText.calculate([
{Index:1,Code:'approx'},
{LineData:' Q1 = 3.2hr ≒ 0.5일'},
{LineData:' Q = Q1 × 2 = \x126.4\x12'}
])""",
)
assert result["errors"] == []
assert result["rows"][2]["TC"] == 6.4
def test_braced_arithmetic_and_survey_point_units():
result = run(
"math",
+1 -1
View File
@@ -55,7 +55,7 @@ Ctrl+S는 입력 중인 셀도 확정한 뒤 저장합니다. 연속 저장 요
이 보완 후 해양 자료는 소계 표지까지 포함해 134,133/134,208 저장값 일치·해석 오류 95건입니다. 계산·이력·연차 전용 시험 74개가 통과했으며, 남은 불일치와 원본 실행 미확인은 별개로 유지합니다.
이후 해양 자료에 나타나는 단위·도식 표기, 그리스 문자 변수, 괄호 앞 생략 곱셈과 중괄호 산식을 처리해 저장값 134,159/134,208 일치·해석 오류 22건으로 개선했습니다. 원본에서 선언값과 숫자 대입식의 부호가 충돌하거나 변수가 누락된 사례는 임의로 수정하지 않았습니다.
이후 해양 자료에 나타나는 단위·도식 표기, 그리스 문자 변수, 괄호 앞 생략 곱셈과 중괄호 산식을 처리해 저장값 134,159/134,208 일치·해석 오류 21건으로 개선했습니다. 원본에서 선언값과 숫자 대입식의 부호가 충돌하거나 변수가 누락된 사례는 임의로 수정하지 않았습니다.
2026-11-06 지정 범위인 설계변경·기성·물가변동·연차의 웹앱 구현을 완료했습니다. 설계변경은 당초 보존·재계산 0/1/2와 신규·삭제·변경 비교를 제공합니다. 삭제된 당초/기성 행 번호를 새 행에 재사용하지 않습니다.
+1
View File
@@ -348,6 +348,7 @@ const EstText = (() => {
end = assignments[j + 1]?.index ?? text.length;
let body = text.slice(assignment.index + assignment[0].length, end);
if (!matched && /⇒.*─/.test(body)) body = body.split("⇒")[0];
if (!matched) body = body.split(/[≈≒]/)[0];
if (!matched && /^\s*\*.*\*\s*$/.test(text)) body = body.replace(/\*\s*$/, "");
body = mathBraces(body);
if (/['"]\s*[A-Za-z][A-Za-z0-9]*\s*=/.test(assignment[0]))