summaryrefslogtreecommitdiff
path: root/2005/i/robert/src/config/lexer.ll
diff options
context:
space:
mode:
Diffstat (limited to '2005/i/robert/src/config/lexer.ll')
-rw-r--r--2005/i/robert/src/config/lexer.ll19
1 files changed, 10 insertions, 9 deletions
diff --git a/2005/i/robert/src/config/lexer.ll b/2005/i/robert/src/config/lexer.ll
index 93173f9..96a90b3 100644
--- a/2005/i/robert/src/config/lexer.ll
+++ b/2005/i/robert/src/config/lexer.ll
@@ -34,7 +34,7 @@
%option bison-bridge
%option noyywrap nodefault nounput
-%x str
+%x strst
INTDEC [+-]?[0-9]+
INTHEX "0x"[0-9a-fA-F]+
@@ -71,7 +71,7 @@ FLOATNUM {FLOAT1}|{FLOAT2}
}
\" {
- BEGIN(str);
+ BEGIN(strst);
yyextra->tmp.clear ();
}
@@ -81,6 +81,7 @@ FLOATNUM {FLOAT1}|{FLOAT2}
"data:" return DATA;
[ \t]+ /* Skip. */
+#.* /* Skip comments. */
. {
yylval->c = yytext[0];
@@ -88,18 +89,18 @@ FLOATNUM {FLOAT1}|{FLOAT2}
return UNKNOWN;
}
-<str>\" {
+<strst>\" {
BEGIN (INITIAL);
yylval->s = new std::string (yyextra->tmp);
return STRING;
}
-<str>\\n yyextra->tmp += '\n';
-<str>\\r yyextra->tmp += '\r';
-<str>\\t yyextra->tmp += '\t';
-<str>\\(.|\n) yyextra->tmp += yytext[1];
-<str>. yyextra->tmp += yytext[0];
-<str>\n {
+<strst>\\n yyextra->tmp += '\n';
+<strst>\\r yyextra->tmp += '\r';
+<strst>\\t yyextra->tmp += '\t';
+<strst>\\(.|\n) yyextra->tmp += yytext[1];
+<strst>. yyextra->tmp += yytext[0];
+<strst>\n {
yylval->c = yytext[0];
return UNKNOWN;
}