From 72889cb191d83cc867fbb7d52dca475a67276f32 Mon Sep 17 00:00:00 2001 From: "Mark M. Hoffman" Date: Sun, 12 Nov 2006 18:36:15 +0000 Subject: [PATCH] Two minor cleanups: 1) remove the yymore() calls, they're no longer necessary; and 2) make the quoted escape sequence rules a little more compact. The first cleanup is said to yield a slight speedup according to the flex manual - I didn't bother to measure it. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4236 7894878c-1315-0410-8ee3-d5d059ff63e0 --- lib/conf-lex.l | 36 +++++++----------------------------- 1 file changed, 7 insertions(+), 29 deletions(-) diff --git a/lib/conf-lex.l b/lib/conf-lex.l index f1770628..b0e8fd94 100644 --- a/lib/conf-lex.l +++ b/lib/conf-lex.l @@ -152,7 +152,6 @@ ignore{BLANK}* { [a-z]+ | . { - yymore(); BEGIN(ERR); strcpy(sensors_lex_error,"Invalid keyword"); return ERROR; @@ -250,7 +249,6 @@ ignore{BLANK}* { . | [[:digit:]]*\. | \\{BLANK}* { - yymore(); BEGIN(ERR); return ERROR; } @@ -304,33 +302,13 @@ ignore{BLANK}* { return NAME; } -\\a { - buffer_add_char("\a"); - } - -\\b { - buffer_add_char("\b"); - } - -\\f { - buffer_add_char("\f"); - } - -\\n { - buffer_add_char("\n"); - } - -\\r { - buffer_add_char("\r"); - } - -\\t { - buffer_add_char("\t"); - } - -\\v { - buffer_add_char("\v"); - } +\\a buffer_add_char("\a"); +\\b buffer_add_char("\b"); +\\f buffer_add_char("\f"); +\\n buffer_add_char("\n"); +\\r buffer_add_char("\r"); +\\t buffer_add_char("\t"); +\\v buffer_add_char("\v"); /* We can't support \0, this would cause havoc! */