summaryrefslogtreecommitdiffstats
path: root/dimension/directives.rules
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2010-02-11 20:32:24 -0500
committerTavian Barnes <tavianator@gmail.com>2010-02-11 20:43:32 -0500
commitcf4f6e6da179114b3d7cfc564889401485b57fdf (patch)
tree9fb122a0631fd2285cc0f72b91a0e4314d8a1abe /dimension/directives.rules
parenta2b5336d126a95b58527151584c249876d50f0e8 (diff)
downloaddimension-cf4f6e6da179114b3d7cfc564889401485b57fdf.tar.xz
Support stream directives.
Diffstat (limited to 'dimension/directives.rules')
-rw-r--r--dimension/directives.rules17
1 files changed, 17 insertions, 0 deletions
diff --git a/dimension/directives.rules b/dimension/directives.rules
index 48cdd77..6f8a812 100644
--- a/dimension/directives.rules
+++ b/dimension/directives.rules
@@ -53,6 +53,23 @@ LANGUAGE_DIRECTIVE: "#include" STRING {
" backwards-compatibility not supported");
dmnsn_delete_astnode($2);
}
+ | "#debug" STRING {
+ fprintf(stderr, "%s\n", (const char *)$2.ptr);
+ dmnsn_delete_astnode($2);
+ }
+ | "#warning" STRING {
+ dmnsn_diagnostic(@$.first_filename, @$.first_line,
+ @$.first_column,
+ "WARNING: %s", (const char *)$2.ptr);
+ dmnsn_delete_astnode($2);
+ }
+ | "#error" STRING {
+ dmnsn_diagnostic(@$.first_filename, @$.first_line,
+ @$.first_column,
+ "%s", (const char *)$2.ptr);
+ dmnsn_delete_astnode($2);
+ YYERROR;
+ }
RVALUE: ARITH_EXPR ";" %dprec 2 {
$$ = dmnsn_eval($1, symtable);