Expand description
命名归一与定向翻译(设计 §6)。唯一实现;core-node / core-py 仅透出。
Enums§
Constants§
- ERR_
NAME_ CONFLICT - 稳定错误前缀(Host 按前缀识别)。经
CoreError::classify(error.rs:46-54) 归入CoreError::Other—— 本步无需改error.rs。 - RESERVED_
KEYS - 契约保留键(归一后的 token 串)。来源 = 字段 / 关系 / 计算列 层实际被消费的契约键:
Functions§
- canonical
- 用户任意写法 → token 序列(全小写)。
- detect_
conflicts - 一组逻辑名(同一命名空间)→ 冲突检测;命中即
Err(ERR_NAME_CONFLICT:),空 = 通过。 - to_
camel - token 序列 → camelCase(
t1+T2) - to_
pascal - token 序列 → PascalCase(
T1T2) - to_
snake - token 序列 → snake_case(
t1_t2) - translate
- 逻辑名 → 目标风格物理名(可逆:先
canonical再按style重组) - translate_
by_ str - 字符串版翻译(绑定入口):目标串非法 ⇒ Err(禁静默回落)