feat: complete INSPECT/SEARCH support, fix PERFORM/EVAL coverage marking
- Add INSPECT (TALLYING/REPLACING/CONVERTING) with BEFORE/AFTER INITIAL - Add SEARCH/SEARCH ALL with element-assignment path enumeration - Fix _mark_perform compound condition marking via evaluate_tree - Fix EVALUATE TRUE prior_false to collect all MC/DC false sets - Add impossible path filtering (Pass A.5) with trace-to-root conflict detection - Fix multi-line PERFORM VARYING parsing (VARYING/FROM/BY/UNTIL on separate lines) - Remove dead code: agents.py LLM parser (replaced by rule-based _BrParser) - 59 unit tests passing, 5 integration programs verified
This commit is contained in:
@@ -7,10 +7,7 @@ from pathlib import Path
|
||||
|
||||
# ── 配置(必须放在本地模块导入之前,避免循环导入) ──
|
||||
|
||||
CONFIG = {
|
||||
"proc_parser": "rule", # "rule" | "ai"
|
||||
"llm_generator": False, # True=启用LLM路径生成; False=纯规则引擎
|
||||
}
|
||||
CONFIG = {}
|
||||
|
||||
from .read import preprocess, extract_data_division, extract_procedure_division
|
||||
from .read import resolve_copybooks, parse_data_division, parse_file_section, scan_open_statements
|
||||
@@ -18,7 +15,6 @@ from .core import build_branch_tree, classify_field_roles, _init_child_names
|
||||
from .cond import parse_single_condition, is_field
|
||||
from .design import enum_paths, generate_records, _filter_stop
|
||||
from .output import output_json, output_input_files
|
||||
from . import agents
|
||||
from .coverage import run_coverage, generate_coverage_index
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@@ -233,14 +229,7 @@ def main():
|
||||
assignments = {}
|
||||
|
||||
if proc_div:
|
||||
if CONFIG["proc_parser"] == "ai":
|
||||
try:
|
||||
result = agents.parse_proc_division_ai(proc_div, fields_dict)
|
||||
branch_tree, assignments = result
|
||||
except NotImplementedError:
|
||||
branch_tree, assignments = build_branch_tree(proc_div, fields_dict)
|
||||
else:
|
||||
branch_tree, assignments = build_branch_tree(proc_div, fields_dict)
|
||||
branch_tree, assignments = build_branch_tree(proc_div, fields_dict)
|
||||
|
||||
roles = classify_field_roles(branch_tree, assignments, fields_dict,
|
||||
source=preprocessed, proc_text=proc_div)
|
||||
@@ -281,14 +270,14 @@ def main():
|
||||
cov_result = run_coverage(branch_tree, branch_paths_with_assigns, fields_dict,
|
||||
source, cov_prefix, index_relpath=index_relpath)
|
||||
|
||||
records = generate_records(branch_paths_with_assigns, fields_dict, assignments, file_sec=file_sec)
|
||||
records, kept_path_cons = generate_records(branch_paths_with_assigns, fields_dict, assignments, file_sec=file_sec)
|
||||
|
||||
# 输出 JSON(完整文件)
|
||||
outpath = outdir / (filepath.stem + '.json')
|
||||
output_json(records, outpath, roles,
|
||||
fd_fields=fd_fields, field_to_fd=field_to_fd,
|
||||
open_dir=open_dir,
|
||||
path_cons_list=[c for c, a in branch_paths_with_assigns])
|
||||
path_cons_list=kept_path_cons)
|
||||
|
||||
# 输出入力 JSON(按 FD 拆分)
|
||||
output_input_files(records, outdir, filepath.stem, roles,
|
||||
|
||||
Reference in New Issue
Block a user