Skip to content

Commit

Permalink
chore: update the comments to better reflect what those parts are doing
Browse files Browse the repository at this point in the history
  • Loading branch information
sod committed Nov 25, 2023
1 parent cd8bfbf commit 19bdf9b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/parsers/pipe.parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,24 +51,24 @@ function traverseAstNode<RESULT extends unknown, NODE extends TmplAstNode | Tmpl
children.push(...node.children);
}

// @for blocks
// contents of @for extra ancestor block @empty
if (node instanceof TmplAstForLoopBlock) {
children.push(node.empty);
}

// @deferred blocks
// contents of @defer extra ancestor blocks @error, @placeholder and @loading
if (node instanceof TmplAstDeferredBlock) {
children.push(node.error);
children.push(node.loading);
children.push(node.placeholder);
}

// @if block
// contents of @if and @else (ignoring the @if(...) condition statement though)
if (node instanceof TmplAstIfBlock) {
children.push(...node.branches.flatMap((inner) => inner.children));
}

// @switch block
// contents of @case blocks (ignoring the @switch(...) statement though)
if (node instanceof TmplAstSwitchBlock) {
children.push(...node.cases.flatMap((inner) => inner.children));
}
Expand Down

0 comments on commit 19bdf9b

Please sign in to comment.