@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/dist/index.d.cts CHANGED
@@ -579,7 +579,7 @@ declare function preprocessVensimModel(input: string, options?: {
579
579
  /**
580
580
  * Parse the given XMILE dimension (`<dim>`) definition and return a `DimensionDef` AST node.
581
581
  *
582
- * @param input A string containing the XMILE `<dim>` definition.
582
+ * @param dimElem An `XmlElement` containing the XMILE `<dim>` definition.
583
583
  * @returns A `DimensionDef` AST node.
584
584
  */
585
585
  declare function parseXmileDimensionDef(dimElem: XmlElement): DimensionDef;
@@ -588,8 +588,6 @@ declare function parseXmileDimensionDef(dimElem: XmlElement): DimensionDef;
588
588
  * Parse the given XMILE model definition and return a `Model` AST node.
589
589
  *
590
590
  * @param input A string containing the XMILE model.
591
- * @param context An object that provides access to file system resources (such as
592
- * external data files) that are referenced during the parse phase.
593
591
  * @returns A `Model` AST node.
594
592
  */
595
593
  declare function parseXmileModel(input: string): Model;
@@ -599,7 +597,7 @@ declare function parseXmileModel(input: string): Model;
599
597
  * corresponding to the variable definition (or definitions, in the case of a
600
598
  * non-apply-to-all variable that is defined with an `<element>` for each subscript).
601
599
  *
602
- * @param input A string containing the XMILE equation definition.
600
+ * @param varElem An `XmlElement` containing the XMILE variable definition.
603
601
  * @returns An `Equation` AST node.
604
602
  */
605
603
  declare function parseXmileVariableDef(varElem: XmlElement): Equation[];
package/dist/index.d.ts CHANGED
@@ -579,7 +579,7 @@ declare function preprocessVensimModel(input: string, options?: {
579
579
  /**
580
580
  * Parse the given XMILE dimension (`<dim>`) definition and return a `DimensionDef` AST node.
581
581
  *
582
- * @param input A string containing the XMILE `<dim>` definition.
582
+ * @param dimElem An `XmlElement` containing the XMILE `<dim>` definition.
583
583
  * @returns A `DimensionDef` AST node.
584
584
  */
585
585
  declare function parseXmileDimensionDef(dimElem: XmlElement): DimensionDef;
@@ -588,8 +588,6 @@ declare function parseXmileDimensionDef(dimElem: XmlElement): DimensionDef;
588
588
  * Parse the given XMILE model definition and return a `Model` AST node.
589
589
  *
590
590
  * @param input A string containing the XMILE model.
591
- * @param context An object that provides access to file system resources (such as
592
- * external data files) that are referenced during the parse phase.
593
591
  * @returns A `Model` AST node.
594
592
  */
595
593
  declare function parseXmileModel(input: string): Model;
@@ -599,7 +597,7 @@ declare function parseXmileModel(input: string): Model;
599
597
  * corresponding to the variable definition (or definitions, in the case of a
600
598
  * non-apply-to-all variable that is defined with an `<element>` for each subscript).
601
599
  *
602
- * @param input A string containing the XMILE equation definition.
600
+ * @param varElem An `XmlElement` containing the XMILE variable definition.
603
601
  * @returns An `Equation` AST node.
604
602
  */
605
603
  declare function parseXmileVariableDef(varElem: XmlElement): Equation[];
package/dist/index.js CHANGED
@@ -1487,7 +1487,7 @@ ${def.def}
1487
1487
 
1488
1488
  Detail:
1489
1489
  ${e.message}`;
1490
- throw new Error(msg);
1490
+ throw new Error(msg, { cause: e });
1491
1491
  }
1492
1492
  for (const dimensionDef of parsedModel.dimensions) {
1493
1493
  const group = def.group;
@@ -1967,7 +1967,7 @@ function parseXmileModel(input) {
1967
1967
  const msg = `Failed to parse XMILE model definition:
1968
1968
 
1969
1969
  ${e.message}`;
1970
- throw new Error(msg);
1970
+ throw new Error(msg, { cause: e });
1971
1971
  }
1972
1972
  const simulationSpec = parseSimSpecs(xml.root, input);
1973
1973
  const dimensions = parseDimensionDefs(xml.root, input);