aboutsummaryrefslogtreecommitdiff
path: root/src/compiler/code_generator
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler/code_generator')
-rw-r--r--src/compiler/code_generator/code_generator.c10
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,