summaryrefslogtreecommitdiffstats
path: root/dimension
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2010-02-11 00:06:54 -0500
committerTavian Barnes <tavianator@gmail.com>2010-02-11 00:06:54 -0500
commit4503f810e8c8c76487c6d52b0699f3a415ff77f9 (patch)
treed6a11cec224e68d9325535636909d27847ee4d70 /dimension
parent141b98f33748b7bb628f8453a4c06a0f6a52c0f4 (diff)
downloaddimension-4503f810e8c8c76487c6d52b0699f3a415ff77f9.tar.xz
Only show user string in #include error messages.
Diffstat (limited to 'dimension')
-rw-r--r--dimension/tokenize.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/dimension/tokenize.c b/dimension/tokenize.c
index 7269fb4..4e499d5 100644
--- a/dimension/tokenize.c
+++ b/dimension/tokenize.c
@@ -191,13 +191,13 @@ dmnsn_include_buffer(int token, dmnsn_token_buffer *prev,
strcat(local_include, "/");
strcat(local_include, include);
free(filename_copy);
- dmnsn_undef_symbol(symtable, "__include__");
FILE *file = fopen(local_include, "r");
if (!file) {
dmnsn_diagnostic(llocp->first_filename, llocp->first_line,
llocp->first_column,
- "Couldn't open include file '%s'", local_include);
+ "Couldn't open include file '%s'", include);
+ dmnsn_undef_symbol(symtable, "__include__");
free(local_include);
dmnsn_delete_token_buffer(tbuffer);
return NULL;
@@ -209,7 +209,8 @@ dmnsn_include_buffer(int token, dmnsn_token_buffer *prev,
dmnsn_diagnostic(llocp->first_filename, llocp->first_line,
llocp->first_column,
"Couldn't allocate buffer for include file '%s'",
- local_include);
+ include);
+ dmnsn_undef_symbol(symtable, "__include__");
fclose(file);
free(local_include);
dmnsn_delete_token_buffer(tbuffer);
@@ -234,6 +235,7 @@ dmnsn_include_buffer(int token, dmnsn_token_buffer *prev,
dmnsn_push_scope(symtable);
+ dmnsn_undef_symbol(symtable, "__include__");
return tbuffer;
}