clarity-pattern-parser 9.2.1 → 9.2.2

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.
@@ -915,8 +915,8 @@
915
915
  }
916
916
  const children = clonePatterns(options);
917
917
  this._assignChildrenToParent(children);
918
- this._id = `or-${idIndex$6++}`;
919
- this._type = "or";
918
+ this._id = `options-${idIndex$6++}`;
919
+ this._type = "options";
920
920
  this._name = name;
921
921
  this._parent = null;
922
922
  this._children = children;
@@ -2101,7 +2101,7 @@
2101
2101
  optionalLineSpaces$1,
2102
2102
  openBracket,
2103
2103
  optionalSpaces$1,
2104
- body.clone("with-params-body"),
2104
+ body,
2105
2105
  optionalSpaces$1,
2106
2106
  closeBracket
2107
2107
  ]));
@@ -2554,11 +2554,12 @@
2554
2554
  return importBlock && importBlock.children.length > 0;
2555
2555
  }
2556
2556
  _buildPatterns(ast) {
2557
- const body = ast.find(n => n.name === "body");
2557
+ const body = ast.find(n => n.name === "body" && n.findAncester(n => n.name === "head") == null);
2558
2558
  if (body == null) {
2559
2559
  return;
2560
2560
  }
2561
- body.findAll(n => n.name === "assign-statement").forEach((n) => {
2561
+ const statements = body.findAll(n => n.name === "assign-statement");
2562
+ statements.forEach((n) => {
2562
2563
  const patternNode = n.children.find(n => patternNodes[n.name] != null);
2563
2564
  if (patternNode == null) {
2564
2565
  return;
@@ -2820,7 +2821,7 @@
2820
2821
  let params = [];
2821
2822
  const paramsStatement = importStatement.find(n => n.name === "with-params-statement");
2822
2823
  if (paramsStatement != null) {
2823
- const statements = paramsStatement.find(n => n.name === "with-params-body");
2824
+ const statements = paramsStatement.find(n => n.name === "body");
2824
2825
  if (statements != null) {
2825
2826
  const expression = statements.toString();
2826
2827
  const importedValues = Array.from(this