X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=plugins%2Fmouse%2Fmouserc_parse.l;h=a72a9d2094768087efaf3c5f199b92c99d8383e5;hb=2dc875f5241b703cf4d1526a2c38c42946ce7ff9;hp=c00728c189693f034a08627b5548876ccc6801fb;hpb=d7b6c79c412c8067e30451c6e7a8f31266644efa;p=chaz%2Fopenbox diff --git a/plugins/mouse/mouserc_parse.l b/plugins/mouse/mouserc_parse.l index c00728c1..a72a9d20 100644 --- a/plugins/mouse/mouserc_parse.l +++ b/plugins/mouse/mouserc_parse.l @@ -7,7 +7,6 @@ static int lineno; static char *path; -static gboolean comment; static gboolean error; static char *context; @@ -21,13 +20,12 @@ static void gotfield(); static void addbinding(); %} -field [A-Za-z0-9][-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] @@ -51,14 +49,12 @@ static void gotfield() 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; @@ -220,7 +216,6 @@ void mouserc_parse() } lineno = 1; - comment = FALSE; error = FALSE; context = event = button = action = NULL;