summaryrefslogtreecommitdiffstats
path: root/dimension/tokenize.c
diff options
context:
space:
mode:
Diffstat (limited to 'dimension/tokenize.c')
-rw-r--r--dimension/tokenize.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/dimension/tokenize.c b/dimension/tokenize.c
index 8e696ed..cc912b6 100644
--- a/dimension/tokenize.c
+++ b/dimension/tokenize.c
@@ -263,9 +263,6 @@ dmnsn_if_buffer(int token, dmnsn_token_buffer *prev,
"syntax error, unexpected end-of-file");
dmnsn_delete_token_buffer(tbuffer);
return NULL;
- } else if (buffered.type == DMNSN_T_LEX_ERROR) {
- dmnsn_delete_token_buffer(tbuffer);
- return NULL;
}
switch (buffered.type) {
@@ -294,7 +291,12 @@ dmnsn_if_buffer(int token, dmnsn_token_buffer *prev,
}
if (cond) {
- dmnsn_array_push(tbuffer->buffered, &buffered);
+ if (buffered.type == DMNSN_T_LEX_ERROR) {
+ dmnsn_delete_token_buffer(tbuffer);
+ return NULL;
+ } else {
+ dmnsn_array_push(tbuffer->buffered, &buffered);
+ }
} else {
free(buffered.lval.value);
}