From a1283a31533c7728f073448cb8a20ea98c5cb40e Mon Sep 17 00:00:00 2001
From: A404M <ahmadmahmoudiprogrammer@gmail.com>
Date: Thu, 19 Sep 2024 04:22:05 +0330
Subject: cleaning up stuff

---
 src/compiler/code_generator/code_generator.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

(limited to 'src/compiler/code_generator')

diff --git a/src/compiler/code_generator/code_generator.c b/src/compiler/code_generator/code_generator.c
index 0beca33..6236d34 100644
--- a/src/compiler/code_generator/code_generator.c
+++ b/src/compiler/code_generator/code_generator.c
@@ -106,7 +106,6 @@ bool nodeToInstruction(ParsedNode *node, Instruction **instructions,
     case PARSED_TOKEN_EOL:
       return nodeToInstruction(node->metadata, instructions, instructions_size,
                                instructions_inserted);
-      break;
     case PARSED_TOKEN_PRINT:
       if (nodeToInstruction(node->metadata, instructions, instructions_size,
                             instructions_inserted)) {
@@ -120,7 +119,6 @@ bool nodeToInstruction(ParsedNode *node, Instruction **instructions,
       } else {
         return false;
       }
-      break;
     case PARSED_TOKEN_VALUE_STRING: {
       SizedString *string = nodeToString(node);
       if (string == NULL) {
@@ -134,11 +132,11 @@ bool nodeToInstruction(ParsedNode *node, Instruction **instructions,
                         instructions_inserted);
       return true;
     }
-    default:
-      fprintf(stderr, "unexpected token %s\n",
-              PARSED_TOKEN_STRINGS[node->token]);
-      return false;
+    case PARSED_TOKEN_NONE:
+    case PARSED_TOKEN_ROOT:
   }
+  fprintf(stderr, "unexpected token %s\n", PARSED_TOKEN_STRINGS[node->token]);
+  return false;
 }
 
 void insertInstruction(const Instruction instruction,
-- 
cgit v1.2.3