增加 JIT REPL

This commit is contained in:
TermiNexus committed 2026-09-21 16:17:19 +08:00
1 parent 9910e05760
commit a5ceb3d4eb
56 files changed
+7621 -584

No files matched your search

+11
View File
@@ -241,9 +241,20 @@ def _join_path(rel: str, project_dir: str) -> str:
拼接结果经 _normalize_path 规范化:./Test/../includes → ./includes,
消除 .. 段,保证路径显示干净且相对寻址正确。
含 %VAR% 的路径(如 repl.vpj 的 build_dir = %temp%/viperepl/.tpv_build)
先经 fileio 路径层展开为实路径:TempDir/OutputDir 等由 BuildDir 派生,
且后续消费者不止文件打开(ensure_dir 直接调 CreateDirectoryA、
collect_obj_files 调 FindFirstFileA、命令串走 CreateProcessA),
故展开必须发生在**配置路径设置层**而不是逐个调用点。
"""
if rel is None:
return None
# 环境变量展开:仅在含 '%' 时生效(fileio.ExpandEnvironmentPath 自带
# "失败/无 '%' 返回 None" 契约),展开失败时保持原串不变
ep: str = fileio.ExpandEnvironmentPath(rel)
if ep is not None:
rel = ep
# 绝对路径(以 / 或 \ 开头)保持不变
if rel[0] == '/' or rel[0] == '\\':
return rel