summaryrefslogtreecommitdiffstats
path: root/dimension
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2010-02-09 23:49:10 -0500
committerTavian Barnes <tavianator@gmail.com>2010-02-09 23:49:10 -0500
commit8bd846528da744e6fc2f741cb0f00e1434488727 (patch)
tree97d226cbcc8999f2285f18c78ea70653db23b7fe /dimension
parent4542f7a7449b4a6c8273ae15d6e854ead0dfe13a (diff)
downloaddimension-8bd846528da744e6fc2f741cb0f00e1434488727.tar.xz
Reject invalid language directives.
Diffstat (limited to 'dimension')
-rw-r--r--dimension/lexer.l5
1 files changed, 5 insertions, 0 deletions
diff --git a/dimension/lexer.l b/dimension/lexer.l
index 9dec45d..d635bd1 100644
--- a/dimension/lexer.l
+++ b/dimension/lexer.l
@@ -218,6 +218,11 @@ unsigned long wchar;
"#undef" RETURN_TOKEN(DMNSN_T_UNDEF);
"#version" RETURN_TOKEN(DMNSN_T_VERSION);
"#while" RETURN_TOKEN(DMNSN_T_WHILE);
+"#"[[:alnum:]_]* {
+ dmnsn_diagnostic(filename, yylineno, yycolumn,
+ "Unrecognized language directive '%s'", yytext);
+ RETURN_TOKEN(DMNSN_T_LEX_ERROR);
+}
(?# Identifiers)
[[:alpha:]][[:alnum:]_]* RETURN_VALUE_TOKEN(DMNSN_T_IDENTIFIER);