Skip to content

Commit

Permalink
refactor: clean unused error type enum
Browse files Browse the repository at this point in the history
  • Loading branch information
zestones committed Feb 11, 2025
1 parent f628a91 commit 8f90345
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
5 changes: 0 additions & 5 deletions src/utils/errors.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ typedef enum
TYPE_ERROR,
LEXICAL_ERROR,
RUN_TIME_ERROR,
INVALID_INPUT_ERROR,
DIVISION_BY_ZERO,
UNINITIALIZED_VARIABLE,
INVALID_OPERATION,
INSUFFICIENT_INDICES,
} ErrorType;

/**
Expand Down
2 changes: 1 addition & 1 deletion src/virtual_machine/interpreter/expression/boolean.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ vm_cell resolve_boolean_expression(Node *expression) {
// Resolve identifier value
vm_cell cell = get_variable_cell(expression->index_declaration);
if (!cell.is_initialized) {
set_error_type(&error, UNINITIALIZED_VARIABLE);
set_error_type(&error, RUN_TIME_ERROR);
set_error_message(
&error,
"Uninitialized variable '%s' at %s.\n"
Expand Down
2 changes: 1 addition & 1 deletion src/virtual_machine/interpreter/expression/expression.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ vm_cell resolve_expression(Node *expression) {
case A_IDENTIFIER: {
vm_cell cell = get_variable_cell(expression->index_declaration);
if (!cell.is_initialized) {
set_error_type(&error, UNINITIALIZED_VARIABLE);
set_error_type(&error, RUN_TIME_ERROR);
set_error_message(
&error,
"Uninitialized variable '%s' at %s.\n"
Expand Down

0 comments on commit 8f90345

Please sign in to comment.