You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
engine: MDL writer emits zero-arg builtin calls like PI() that the MDL parser rejects (Vensim has no PI builtin) #850
The MDL writer prints zero-argument builtin calls such as XMILE pi() as PI(). This output is doubly wrong:
simlin's own MDL parser rejects it on re-parse: symbol call requires at least one argument.
Vensim has no PI builtin at all, so the exported file is invalid Vensim MDL regardless.
In src/simlin-engine/src/mdl/writer.rs, mdl_bare_keyword (~line 181) only handles time, dt/time_step, starttime/initial_time, and endtime/stoptime/final_time; pi (and any other zero-arg builtin) falls through to the generic uppercase-function path and prints as NAME().
Impact
Part of the 29/240 re-parse failures found by a corpus sweep (parse -> project_to_mdl -> re-parse over all test/**/*.mdl under 200KB). Affected fixtures include:
Emit a numeric literal for pi() (e.g. 3.14159265358979), matching what Vensim models actually contain. More generally, audit all zero-arg XMILE builtins reachable through the writer and give each an explicit MDL rendering (bare keyword, literal, or a documented reject) instead of the generic NAME() fallback. The corpus re-parse sweep from #847 would gate this too.
Related: #847 tracks the other (larger) re-parse failure class, wildcard subscripts printed as * instead of Dim!.
Context: identified during an MDL writer round-trip corpus sweep.
Activity