Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
crcn committed Sep 10, 2023
1 parent c9f332b commit 56066a2
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions libs/proto_ext/src/ast/pc-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
Document,
DocumentBodyItem,
Element,
Script,
Import,
Insert,
Node,
Expand Down Expand Up @@ -44,6 +45,7 @@ export namespace ast {
Variant,
Document,
Render,
Script,
Import,
TextNode,
Trigger,
Expand All @@ -69,6 +71,7 @@ export namespace ast {
| BaseExprInfo<Atom, ExprKind.Atom>
| BaseExprInfo<Reference, ExprKind.Reference>
| BaseExprInfo<Trigger, ExprKind.Trigger>
| BaseExprInfo<Script, ExprKind.Script>
| BaseExprInfo<Element, ExprKind.Element>
| BaseExprInfo<Variant, ExprKind.Variant>
| BaseExprInfo<Document, ExprKind.Document>
Expand Down Expand Up @@ -208,6 +211,12 @@ export namespace ast {
kind: ExprKind.Render,
};
}
if ((expr as ComponentBodyItem).script) {
return {
expr: (expr as ComponentBodyItem).script,
kind: ExprKind.Script,
};
}
if ((expr as ComponentBodyItem).variant) {
return {
expr: (expr as ComponentBodyItem).variant,
Expand Down Expand Up @@ -241,6 +250,8 @@ export namespace ast {
};
}

console.error(expr);

throw new Error(`Unhandled type`);
};

Expand Down

0 comments on commit 56066a2

Please sign in to comment.