diff options
author | A404M <ahmadmahmoudiprogrammer@gmail.com> | 2024-09-19 04:22:05 +0330 |
---|---|---|
committer | A404M <ahmadmahmoudiprogrammer@gmail.com> | 2024-09-19 04:22:05 +0330 |
commit | a1283a31533c7728f073448cb8a20ea98c5cb40e (patch) | |
tree | 3c0f6afc933c6447aad523726b70fd49925f0f9a /src/compiler/code_generator | |
parent | b6c2872fd2b4441e4c98b365e7401c5848d58154 (diff) |
cleaning up stuff
Diffstat (limited to 'src/compiler/code_generator')
-rw-r--r-- | src/compiler/code_generator/code_generator.c | 10 |
1 files changed, 4 insertions, 6 deletions
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, |