diff options
author | Tavian Barnes <tavianator@gmail.com> | 2010-02-09 23:49:10 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@gmail.com> | 2010-02-09 23:49:10 -0500 |
commit | 8bd846528da744e6fc2f741cb0f00e1434488727 (patch) | |
tree | 97d226cbcc8999f2285f18c78ea70653db23b7fe /dimension | |
parent | 4542f7a7449b4a6c8273ae15d6e854ead0dfe13a (diff) | |
download | dimension-8bd846528da744e6fc2f741cb0f00e1434488727.tar.xz |
Reject invalid language directives.
Diffstat (limited to 'dimension')
-rw-r--r-- | dimension/lexer.l | 5 |
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); |