@sdeverywhere/compile 0.7.7 → 0.7.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sdeverywhere/compile",
3
- "version": "0.7.7",
3
+ "version": "0.7.8",
4
4
  "description": "The core Vensim to C compiler for the SDEverywhere tool suite.",
5
5
  "type": "module",
6
6
  "files": [
@@ -1023,7 +1023,13 @@ function allListedVars() {
1023
1023
  vars.push(...constVars())
1024
1024
  vars.push(...lookupVars())
1025
1025
  vars.push(...dataVars())
1026
- vars.push(varWithName('_time'))
1026
+ // The special exogenous `Time` variable may have already been removed by
1027
+ // `removeUnusedVariables` if it is not referenced explicitly in the model,
1028
+ // so we will only include it in the listing if it is defined here
1029
+ const timeVar = varWithName('_time')
1030
+ if (timeVar) {
1031
+ vars.push(timeVar)
1032
+ }
1027
1033
  vars.push(...initVars())
1028
1034
  vars.push(...auxVars())
1029
1035
  // TODO: Also levelVars not covered by initVars?