summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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);