X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fparse.l;h=a7cd6c636b2d71b08cc901d798aab63541554278;hb=f7df74b9cc9369fe401d5622c097e258a124f742;hp=c888b9f1a9fc2752db6404008963ad89dcf35101;hpb=71c8b0b7b2cf2fa79ac4c81b7756f2b230f2de7a;p=chaz%2Fopenbox diff --git a/openbox/parse.l b/openbox/parse.l index c888b9f1..a7cd6c63 100644 --- a/openbox/parse.l +++ b/openbox/parse.l @@ -1,26 +1,23 @@ %{ -#include -#include "y.tab.h" +#include "parse.h" #ifdef HAVE_STDLIB_H # include #endif -extern void yyerror(char *err); - -int yylineno = 1; +extern int lineno; %} real [-0-9][0-9]*\.[0-9]+ integer [-0-9][0-9]* string \"[^"\n]*\" -identifier [a-zA-Z][.a-zA-Z0-9]* +identifier [a-zA-Z][-.a-zA-Z0-9_]* bool ([tT][rR][uU][eE]|[fF][aA][lL][sS][eE]|[yY][eE][sS]|[nN][oO]|[oO][nN]|[oO][fF][fF]) %% -^[ \t]*#.*\n /* comment */ { ++yylineno; } +^[ \t]*#.*\n /* comment */ { ++lineno; } ^[ \t]*#.* /* comment */ -^[ \t]*\n /* empty lines */ { ++yylineno; } +^[ \t]*\n /* empty lines */ { ++lineno; } [ \t] /* whitespace */ {real} { yylval.real = atof(yytext); return REAL; } {integer} { yylval.integer = atoi(yytext); return INTEGER; } @@ -34,11 +31,11 @@ bool ([tT][rR][uU][eE]|[fF][aA][lL][sS][eE]|[yY][eE][sS]|[nN][oO]|[oO][nN]|[oO][ {bool} { yylval.bool = (!g_ascii_strcasecmp("true", yytext) || !g_ascii_strcasecmp("yes", yytext) || !g_ascii_strcasecmp("on", yytext)); - return BOOL; + return BOOLEAN; } {identifier} { yylval.identifier = g_strdup(yytext); return IDENTIFIER; } [{}()\[\]=,] { yylval.character = *yytext; return *yytext; } -\n { yylval.character = *yytext; ++yylineno; return *yytext; } +\n { yylval.character = *yytext; return *yytext; } . { return INVALID; } %%