Remove dead code in the compiler

This commit is contained in:
gingerBill
2022-12-18 22:49:10 +00:00
parent 6cdec65ca1
commit c1f5be24e2
28 changed files with 165 additions and 1657 deletions

View File

@@ -53,7 +53,6 @@ gb_internal Token ast_token(Ast *node) {
case Ast_BadStmt: return node->BadStmt.begin;
case Ast_EmptyStmt: return node->EmptyStmt.token;
case Ast_ExprStmt: return ast_token(node->ExprStmt.expr);
case Ast_TagStmt: return node->TagStmt.token;
case Ast_AssignStmt: return node->AssignStmt.op;
case Ast_BlockStmt: return node->BlockStmt.open;
case Ast_IfStmt: return node->IfStmt.token;
@@ -197,7 +196,6 @@ Token ast_end_token(Ast *node) {
case Ast_BadStmt: return node->BadStmt.end;
case Ast_EmptyStmt: return node->EmptyStmt.token;
case Ast_ExprStmt: return ast_end_token(node->ExprStmt.expr);
case Ast_TagStmt: return ast_end_token(node->TagStmt.stmt);
case Ast_AssignStmt:
if (node->AssignStmt.rhs.count > 0) {
return ast_end_token(node->AssignStmt.rhs[node->AssignStmt.rhs.count-1]);