summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2010-02-11 00:12:12 -0500
committerTavian Barnes <tavianator@gmail.com>2010-02-11 00:12:12 -0500
commit6dfea71b967f6e4ab1372a26653bf806f77443c7 (patch)
tree5d5d6cdcf47f8783b05bf100896a83a4ca8d5e80
parent4503f810e8c8c76487c6d52b0699f3a415ff77f9 (diff)
downloaddimension-6dfea71b967f6e4ab1372a26653bf806f77443c7.tar.xz
Support spaces after the '#' in language directives.
-rw-r--r--dimension/lexer.l24
1 files changed, 12 insertions, 12 deletions
diff --git a/dimension/lexer.l b/dimension/lexer.l
index d206605..d065ed5 100644
--- a/dimension/lexer.l
+++ b/dimension/lexer.l
@@ -207,18 +207,18 @@ unsigned long wchar;
"z" RETURN_TOKEN(DMNSN_T_Z);
(?# Directives)
-"#declare" RETURN_TOKEN(DMNSN_T_DECLARE);
-"#else" RETURN_TOKEN(DMNSN_T_ELSE);
-"#end" RETURN_TOKEN(DMNSN_T_END);
-"#if" RETURN_TOKEN(DMNSN_T_IF);
-"#ifdef" RETURN_TOKEN(DMNSN_T_IFDEF);
-"#ifndef" RETURN_TOKEN(DMNSN_T_IFNDEF);
-"#include" RETURN_TOKEN(DMNSN_T_INCLUDE);
-"#local" RETURN_TOKEN(DMNSN_T_LOCAL);
-"#undef" RETURN_TOKEN(DMNSN_T_UNDEF);
-"#version" RETURN_TOKEN(DMNSN_T_VERSION);
-"#while" RETURN_TOKEN(DMNSN_T_WHILE);
-"#"[[:alnum:]_]* {
+#[\b\r\t\v ]*declare RETURN_TOKEN(DMNSN_T_DECLARE);
+#[\b\r\t\v ]*else RETURN_TOKEN(DMNSN_T_ELSE);
+#[\b\r\t\v ]*end RETURN_TOKEN(DMNSN_T_END);
+#[\b\r\t\v ]*if RETURN_TOKEN(DMNSN_T_IF);
+#[\b\r\t\v ]*ifdef RETURN_TOKEN(DMNSN_T_IFDEF);
+#[\b\r\t\v ]*ifndef RETURN_TOKEN(DMNSN_T_IFNDEF);
+#[\b\r\t\v ]*include RETURN_TOKEN(DMNSN_T_INCLUDE);
+#[\b\r\t\v ]*local RETURN_TOKEN(DMNSN_T_LOCAL);
+#[\b\r\t\v ]*undef RETURN_TOKEN(DMNSN_T_UNDEF);
+#[\b\r\t\v ]*version RETURN_TOKEN(DMNSN_T_VERSION);
+#[\b\r\t\v ]*while RETURN_TOKEN(DMNSN_T_WHILE);
+#[\b\r\t\v ]*[[:alnum:]_]* {
dmnsn_diagnostic(filename, yylineno, yycolumn,
"Unrecognized language directive '%s'", yytext);
RETURN_TOKEN(DMNSN_T_LEX_ERROR);