summaryrefslogtreecommitdiff
path: root/i/marvin/src/parser/yylexer.ll
diff options
context:
space:
mode:
Diffstat (limited to 'i/marvin/src/parser/yylexer.ll')
-rw-r--r--i/marvin/src/parser/yylexer.ll30
1 files changed, 28 insertions, 2 deletions
diff --git a/i/marvin/src/parser/yylexer.ll b/i/marvin/src/parser/yylexer.ll
index 084de8f..be8d41c 100644
--- a/i/marvin/src/parser/yylexer.ll
+++ b/i/marvin/src/parser/yylexer.ll
@@ -45,16 +45,42 @@ DOUBLENUM {DOUBLE1}|{DOUBLE2}|{DOUBLE3}
%%
-"true"|"on" {
+"true"|"on"|"yes" {
yylval->b = true;
return BOOLEAN;
}
-"false"|"off" {
+"false"|"off"|"no" {
yylval->b = false;
return BOOLEAN;
}
+"'"\\n"'" {
+ yylval->c = '\n';
+ return CHAR;
+}
+"'"\\r"'" {
+ yylval->c = '\r';
+ return CHAR;
+}
+"'"\\t"'" {
+ yylval->c = '\t';
+ return CHAR;
+}
+"'"\\."'" {
+ yylval->c = yytext[1];
+ return CHAR;
+}
+"'"\\\n"'" {
+ yyextra->line++;
+ yylval->c = yytext[1];
+ return CHAR;
+}
+"'"."'" {
+ yylval->c = yytext[1];
+ return CHAR;
+}
+
[a-zA-Z][_a-zA-Z0-9.-]* {
yylval->s = new std::string (yytext);
return ID;