gingerBill há 3 anos atrás
pai
commit
3cbf9c3719
1 ficheiros alterados com 9 adições e 0 exclusões
  1. 9 0
      src/parser.cpp

+ 9 - 0
src/parser.cpp

@@ -5362,6 +5362,15 @@ isize calc_decl_count(Ast *decl) {
 			count += calc_decl_count(decl->BlockStmt.stmts.data[i]);
 		}
 		break;
+	case Ast_WhenStmt:
+		{
+			isize inner_count = calc_decl_count(decl->WhenStmt.body);
+			if (decl->WhenStmt.else_stmt) {
+				inner_count = gb_max(inner_count, calc_decl_count(decl->WhenStmt.else_stmt));
+			}
+			count += inner_count;
+		}
+		break;
 	case Ast_ValueDecl:
 		count = decl->ValueDecl.names.count;
 		break;