@sdeverywhere/parse 0.1.4 → 0.1.6

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/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  This package contains the parsing layer used by the [SDEverywhere](https://github.com/climateinteractive/SDEverywhere) compiler.
4
4
  It defines an AST (abstract syntax tree) structure that can be used to express a system dynamics model, and provides an API for parsing a model into an AST structure.
5
- Currently the only implemented input format is Vensim's `mdl` format, but support for the XMILE format is under discussion.
5
+ The currently supported input formats are Vensim's `mdl` format and the XMILE format (as used by Stella products).
6
6
 
7
7
  Note: The `parse` API has not yet stabilized, and the package is primarily intended as an implementation detail of the `compile` package, so documentation is not provided at this time.
8
8
  If you would like to help with the task of stabilizing and formalizing the API for external consumption, please get in touch on the [discussion board](https://github.com/climateinteractive/SDEverywhere/discussions).
package/dist/index.cjs CHANGED
@@ -1538,7 +1538,7 @@ ${def.def}
1538
1538
 
1539
1539
  Detail:
1540
1540
  ${e.message}`;
1541
- throw new Error(msg);
1541
+ throw new Error(msg, { cause: e });
1542
1542
  }
1543
1543
  for (const dimensionDef of parsedModel.dimensions) {
1544
1544
  const group = def.group;
@@ -2018,7 +2018,7 @@ function parseXmileModel(input) {
2018
2018
  const msg = `Failed to parse XMILE model definition:
2019
2019
 
2020
2020
  ${e.message}`;
2021
- throw new Error(msg);
2021
+ throw new Error(msg, { cause: e });
2022
2022
  }
2023
2023
  const simulationSpec = parseSimSpecs(xml.root, input);
2024
2024
  const dimensions = parseDimensionDefs(xml.root, input);