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
The antlr4-vensim package historically only allowed for ASCII / Latin characters when reading (Vensim) variable names. A request was submitted in the antlr4-vensim repo (see climateinteractive/antlr4-vensim#12) to extend the grammar to allow for non-Latin (e.g., Chinese) characters in variable names (identifiers).
Once the fix is merged and published in antlr4-vensim, we should update the parse package to use the latest. I will also add an integration test to verify that non-Latin characters can be used in mdl files and that they are accepted in the parse/compile and runtime packages without issue.
For the record, prior to this fix, the parse package would throw an error if it encounters non-Latin characters in identifier position:
Generating model...
Error: Failed to parse Vensim model definition at line 15:
中文变量名 X = TIME ~~|
Detail:
token recognition error at: '中'
at parseVensimModel (file://.../sdeverywhere/packages/parse/dist/index.js:1408:13)
at parseModel (file://.../sdeverywhere/packages/compile/src/parse-and-generate.js:166:16)
at parseAndGenerate (file://.../sdeverywhere/packages/compile/src/parse-and-generate.js:70:21)
at generate (file://.../sdeverywhere/packages/cli/src/sde-generate.js:97:9)
After the fix, the characters will be accepted without errors.
The text was updated successfully, but these errors were encountered:
The antlr4-vensim package historically only allowed for ASCII / Latin characters when reading (Vensim) variable names. A request was submitted in the antlr4-vensim repo (see climateinteractive/antlr4-vensim#12) to extend the grammar to allow for non-Latin (e.g., Chinese) characters in variable names (identifiers).
Once the fix is merged and published in antlr4-vensim, we should update the parse package to use the latest. I will also add an integration test to verify that non-Latin characters can be used in mdl files and that they are accepted in the parse/compile and runtime packages without issue.
For the record, prior to this fix, the parse package would throw an error if it encounters non-Latin characters in identifier position:
After the fix, the characters will be accepted without errors.
The text was updated successfully, but these errors were encountered: