diff --git a/config.l b/config.l index 97afd86..8ee48a6 100644 --- a/config.l +++ b/config.l @@ -1,8 +1,5 @@ /* Lexical analyzer for dgamelaunch's configuration file. */ -%option nounput -%option noyywrap - %{ #include @@ -27,13 +24,12 @@ WHITE [\t ]* COMMENT ^#.* LONGCOMMENT "/*" -%% /* BEGIN RULES SECTION */ +%% {NUMBER} { yylval.i = atoi(yytext); return TYPE_NUMBER; } {VALUE} { yytext[yyleng - 1] = '\0'; /* Kill the trailing quote */ - yytext++; /* Kill the leading quote */ - yylval.s = strdup(yytext); + yylval.s = strdup(yytext + 1); /* kill leading quote */ return TYPE_VALUE; }