static int lineno;
static char *path;
-static gboolean comment;
static gboolean error;
static char *context;
static void addbinding();
%}
-field [-A-Za-z0-9]+
-sep [ \t]+
+field [A-Za-z0-9][-A-Za-z0-9]*
white [ \t]*
%%
-^{white}# comment = TRUE;
+^{white}\#.+\n lineno++;
{field} gotfield();
\n endofline();
[ \t]
static void endofline()
{
- if (!comment) {
- if (!error && context && event && button && action)
- addbinding();
- else if (error || context || event || button || action)
- g_warning("Parser error in '%s' on line %d", path, lineno);
- }
+ if (!error && context && event && button && action)
+ addbinding();
+ else if (error || context || event || button || action)
+ g_warning("Parser error in '%s' on line %d", path, lineno);
- comment = error = FALSE;
+ error = FALSE;
g_free(context); g_free(event); g_free(button); g_free(action);
context = event = button = action = NULL;
}
lineno = 1;
- comment = FALSE;
error = FALSE;
context = event = button = action = NULL;