Skip to contentSkip to conversation

tabs on otherwise empty lines

DISCUSSION William Lee Irwin III 2 participants 2 messages Dec 29, 2002 – Dec 30, 2002 Kconfig

lore
Share & tools
lore
#0 lore raw

The <HELP> state is willing to consume config options as part of help texts AFAICT:

(1) [ \t]+ {
(2) \n/[^ \t\n] {
(3) [ \t]*\n {
(4) [^ \t\n].* {
(5) <<EOF>> {

Now consider: "\tSome help text.\n\t\nconfig FOO\n\tdepends on BAR\n"

"\tSome help text." is consumed by (1).
"\n" is consumed by (3).
"\t\n" is consumed by (3) again.
"config FOO" is consumed by (4), which resets first_ts to last_ts,
which does not actually change the value of first_ts.
"\tdepends on BAR\n" is consumed by (1), and does not zconf_endhelp()
as the indentation level is the same as for "\tSome help text."

Better boundary detection logic is needed here.

Thanks,
Bill

#1 lore raw

Hi,

Quoted 10 lines · William Lee Irwin III

The <HELP> state is willing to consume config options as part of help texts AFAICT:

(1) [ \t]+ {
(2) \n/[^ \t\n] {
(3) [ \t]*\n {
(4) [^ \t\n].* {
(5) <<EOF>> {

Now consider: "\tSome help text.\n\t\nconfig FOO\n\tdepends on BAR\n"

Try to change (2) into [ \t]*\n/[^ \t\n]
This should eat these empty lines correctly. I'll have to test it a bit more. Thanks for finding this.

bye, Roman

scripts/kconfig/zconf.l +1 -1
@@ -208,7 +208,7 @@
 		}
 
 	}
-	\n/[^ \t\n] {
+	[ \t]*\n/[^ \t\n] {
 		current_file->lineno++;
 		zconf_endhelp();
 		return T_HELPTEXT;
scripts/kconfig/lex.zconf.c_shipped +5 -5
@@ -853,10 +853,10 @@
     },
 
     {
-       11,  -76,  -76,  -76,  -76,  -76,  -76,  -76,  -76,  -76,
-      -76,  -76,  -76,  -76,  -76,  -76,  -76,  -76,  -76,  -76,
-      -76,  -76,  -76,  -76,  -76,  -76,  -76,  -76,  -76,  -76,
-      -76,  -76,  -76,  -76,  -76,  -76,  -76
+       11,   77,  -76,  -76,   77,   77,   77,   77,   77,   77,
+       77,   77,   77,   77,   77,   77,   77,   77,   77,   77,
+       77,   77,   77,   77,   77,   77,   77,   77,   77,   77,
+       77,   77,   77,   77,   77,   77,   77
     },
 
     {
@@ -2229,7 +2229,7 @@
 	YY_BREAK
 case 53:
 *yy_cp = yy_hold_char; /* undo effects of setting up yytext */
-yy_c_buf_p = yy_cp = yy_bp + 1;
+yy_c_buf_p = yy_cp -= 1;
 YY_DO_BEFORE_ACTION; /* set up yytext again */
 YY_RULE_SETUP
 {