#[unsafe(no_mangle)]pub extern "C" fn sml_parse_ex(
text: *const c_char,
opts: *const c_char,
) -> *mut c_charExpand description
sml_parse_ex(text, opts_json) -> JSON 字符串 (调用方 sml_free) 或 NULL。
opts_json 示例: {“features”:[“glob-include”,“contract”],“env”:{“APP_ENV”:“prod”},“allow”:[“v1”,“v3”]}
- features: 调用方额外启用的特性 (与文档 @feature 取交集)。
- env: 注入到进程环境, 供
$env.X内联解析 (调用期间临时设置并恢复)。 - allow: 限定文档声明的版本必须在此范围内; 空数组表示不限制。 失败 (语法/版本/特性越权/文件找不到) 返回 NULL。