static void stringvalue();
static void numbervalue();
+static void boolvalue();
static void identifier();
static void newline();
static int yywrap();
identifier [a-zA-Z][a-zA-Z0-9_.]*
white [ \t]*
assign {white}={white}
+bool ([tT][rR][uU][eE]|[fF][aA][lL][sS][eE]|[yY][eE][sS]|[nN][oO]|[oO][nN]|[oO][fF][fF])
%%
+^# comment = TRUE;
+{bool}/{white}\n boolvalue();
{string}/{white}\n stringvalue();
{number}/{white}\n numbervalue();
^{identifier}/{assign} identifier();
\n newline();
-^# comment = TRUE;
=
[ \t]
-. haserror = TRUE;
+. if (!comment) haserror = TRUE;
%%
}
}
+static void boolvalue()
+{
+ if (!comment) {
+ if (!haserror && entry.name != NULL && (signed)entry.type < 0) {
+ entry.type = Config_Bool;
+ entry.value.bool = (!g_ascii_strcasecmp("true", yytext) ||
+ !g_ascii_strcasecmp("yes", yytext) ||
+ !g_ascii_strcasecmp("on", yytext));
+ } else
+ haserror = TRUE;
+ }
+}
+
static void identifier()
{
if (!comment) {
haserror = FALSE;
}
+ comment = FALSE;
++yylineno;
}