Skip to content

Commit 20b1f01

Browse files
committed
fix: unitest
1 parent 78c1919 commit 20b1f01

File tree

1 file changed

+5
-2
lines changed
  • packages/shader-lab/src/parser

1 file changed

+5
-2
lines changed

packages/shader-lab/src/parser/AST.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,7 @@ export namespace ASTNode {
152152
return this._type ?? TypeAny;
153153
}
154154

155-
override set(loc: ShaderRange, children: NodeChild[]) {
156-
super.set(loc, children);
155+
override init(): void {
157156
this._type = undefined;
158157
}
159158
}
@@ -694,6 +693,7 @@ export namespace ASTNode {
694693
fnSymbol: FnSymbol | StructSymbol | undefined;
695694

696695
override init(): void {
696+
super.init();
697697
this.fnSymbol = undefined;
698698
}
699699

@@ -858,6 +858,7 @@ export namespace ASTNode {
858858
@ASTNodeDecorator(ENonTerminal.postfix_expression)
859859
export class PostfixExpression extends ExpressionAstNode {
860860
override init(): void {
861+
super.init();
861862
if (this.children.length === 1) {
862863
const child = this.children[0] as PrimaryExpression | FunctionCall;
863864
this.type = child.type;
@@ -883,6 +884,7 @@ export namespace ASTNode {
883884
@ASTNodeDecorator(ENonTerminal.multiplicative_expression)
884885
export class MultiplicativeExpression extends ExpressionAstNode {
885886
override init(): void {
887+
super.init();
886888
if (this.children.length === 1) {
887889
this.type = (this.children[0] as UnaryExpression).type;
888890
} else {
@@ -898,6 +900,7 @@ export namespace ASTNode {
898900
@ASTNodeDecorator(ENonTerminal.additive_expression)
899901
export class AdditiveExpression extends ExpressionAstNode {
900902
override init(): void {
903+
super.init();
901904
if (this.children.length === 1) {
902905
this.type = (this.children[0] as MultiplicativeExpression).type;
903906
} else {

0 commit comments

Comments
 (0)