summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormmh <mmh@7894878c-1315-0410-8ee3-d5d059ff63e0>2006-09-15 11:08:39 +0000
committermmh <mmh@7894878c-1315-0410-8ee3-d5d059ff63e0>2006-09-15 11:08:39 +0000
commita1a31f68d3fdc869a13b3cfc44c1cb488c2cd07a (patch)
tree50417ab74dd5cdf29721c952ec9b2036ef55d6e8
parentba370ec915ecac81a5b1c6b23703d5ab13194ae7 (diff)
downloadlm-sensors-a1a31f68d3fdc869a13b3cfc44c1cb488c2cd07a.tar.gz
Subtle bugfix: if a keyword is not followed by whitespace, we still need to
accept it as lexically correct (even though the parser will reject it anyway.) git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/scanner-opt-branch@4156 7894878c-1315-0410-8ee3-d5d059ff63e0
-rw-r--r--lib/conf-lex.l19
1 files changed, 12 insertions, 7 deletions
diff --git a/lib/conf-lex.l b/lib/conf-lex.l
index 4c96f1ce..bee0b1b7 100644
--- a/lib/conf-lex.l
+++ b/lib/conf-lex.l
@@ -105,39 +105,44 @@ OCTESC (1[0-7]{0,2})|([2-7][0-7]?)|(0[1-7][0-7]?)|(00[1-7])
sensors_yylineno++;
}
- /* Keywords must be followed by whitespace - eat that too */
+ /*
+ * Keywords must be followed by whitespace - eat that too.
+ * If there isn't trailing whitespace, we still need to
+ * accept it as lexically correct (even though the parser
+ * will reject it anyway.)
+ */
-label{BLANK}+ {
+label{BLANK}* {
sensors_yylval.line = sensors_yylineno;
BEGIN(MIDDLE);
return LABEL;
}
-set{BLANK}+ {
+set{BLANK}* {
sensors_yylval.line = sensors_yylineno;
BEGIN(MIDDLE);
return SET;
}
-compute{BLANK}+ {
+compute{BLANK}* {
sensors_yylval.line = sensors_yylineno;
BEGIN(MIDDLE);
return COMPUTE;
}
-bus{BLANK}+ {
+bus{BLANK}* {
sensors_yylval.line = sensors_yylineno;
BEGIN(MIDDLE);
return BUS;
}
-chip{BLANK}+ {
+chip{BLANK}* {
sensors_yylval.line = sensors_yylineno;
BEGIN(MIDDLE);
return CHIP;
}
-ignore{BLANK}+ {
+ignore{BLANK}* {
sensors_yylval.line = sensors_yylineno;
BEGIN(MIDDLE);
return IGNORE;