Skip to content

Commit

Permalink
Make it possible to undefine
Browse files Browse the repository at this point in the history
  • Loading branch information
Noam Preil committed Jul 8, 2020
1 parent 58350e3 commit 17b0c92
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions assembler/assembler.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@ int try_expand_macro(struct assembler_state *state, char **line) {
if (strstr(*line, "macro") == *line + 1) { // Cannot expand macros while defining them
return 0;
}
if (strstr(*line, "undefine") == *line + 1) { // Should not expand while removing
return 0;
}
if (strstr(*line, "ifdef") == *line + 1) { // Should not expand when testing for existence
return 0;
}
Expand Down
2 changes: 2 additions & 0 deletions assembler/directives.c
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,8 @@ int handle_undef(struct assembler_state *state, char **argv, int argc) {
return 1;
}

scas_log(L_DEBUG, "Looking for %s", argv[0]);

int i;
for (i = 0; i < state->macros->length; i++) {
macro_t *m = state->macros->items[i];
Expand Down

0 comments on commit 17b0c92

Please sign in to comment.