|
@@ -1,5 +1,5 @@
|
|
|
%option nostdinit noyywrap never-interactive full ecs
|
|
|
-%option 8bit nodefault perf-report perf-report
|
|
|
+%option 8bit nodefault yylineno
|
|
|
%option noinput
|
|
|
%x COMMAND HELP STRING PARAM
|
|
|
%{
|
|
@@ -83,7 +83,6 @@ n [A-Za-z0-9_-]
|
|
|
|
|
|
[ \t]*#.*\n |
|
|
|
[ \t]*\n {
|
|
|
- current_file->lineno++;
|
|
|
return T_EOL;
|
|
|
}
|
|
|
[ \t]*#.*
|
|
@@ -104,7 +103,7 @@ n [A-Za-z0-9_-]
|
|
|
const struct kconf_id *id = kconf_id_lookup(yytext, yyleng);
|
|
|
BEGIN(PARAM);
|
|
|
current_pos.file = current_file;
|
|
|
- current_pos.lineno = current_file->lineno;
|
|
|
+ current_pos.lineno = yylineno;
|
|
|
if (id && id->flags & TF_COMMAND) {
|
|
|
yylval.id = id;
|
|
|
return id->token;
|
|
@@ -116,7 +115,6 @@ n [A-Za-z0-9_-]
|
|
|
. warn_ignored_character(*yytext);
|
|
|
\n {
|
|
|
BEGIN(INITIAL);
|
|
|
- current_file->lineno++;
|
|
|
return T_EOL;
|
|
|
}
|
|
|
}
|
|
@@ -138,7 +136,7 @@ n [A-Za-z0-9_-]
|
|
|
new_string();
|
|
|
BEGIN(STRING);
|
|
|
}
|
|
|
- \n BEGIN(INITIAL); current_file->lineno++; return T_EOL;
|
|
|
+ \n BEGIN(INITIAL); return T_EOL;
|
|
|
({n}|[/.])+ {
|
|
|
const struct kconf_id *id = kconf_id_lookup(yytext, yyleng);
|
|
|
if (id && id->flags & TF_PARAM) {
|
|
@@ -150,7 +148,7 @@ n [A-Za-z0-9_-]
|
|
|
return T_WORD;
|
|
|
}
|
|
|
#.* /* comment */
|
|
|
- \\\n current_file->lineno++;
|
|
|
+ \\\n ;
|
|
|
[[:blank:]]+
|
|
|
. warn_ignored_character(*yytext);
|
|
|
<<EOF>> {
|
|
@@ -187,7 +185,6 @@ n [A-Za-z0-9_-]
|
|
|
fprintf(stderr,
|
|
|
"%s:%d:warning: multi-line strings not supported\n",
|
|
|
zconf_curname(), zconf_lineno());
|
|
|
- current_file->lineno++;
|
|
|
BEGIN(INITIAL);
|
|
|
return T_EOL;
|
|
|
}
|
|
@@ -220,12 +217,10 @@ n [A-Za-z0-9_-]
|
|
|
}
|
|
|
}
|
|
|
[ \t]*\n/[^ \t\n] {
|
|
|
- current_file->lineno++;
|
|
|
zconf_endhelp();
|
|
|
return T_HELPTEXT;
|
|
|
}
|
|
|
[ \t]*\n {
|
|
|
- current_file->lineno++;
|
|
|
append_string("\n", 1);
|
|
|
}
|
|
|
[^ \t\n].* {
|
|
@@ -304,7 +299,7 @@ void zconf_initscan(const char *name)
|
|
|
memset(current_buf, 0, sizeof(*current_buf));
|
|
|
|
|
|
current_file = file_lookup(name);
|
|
|
- current_file->lineno = 1;
|
|
|
+ yylineno = 1;
|
|
|
}
|
|
|
|
|
|
void zconf_nextfile(const char *name)
|
|
@@ -325,6 +320,7 @@ void zconf_nextfile(const char *name)
|
|
|
buf->parent = current_buf;
|
|
|
current_buf = buf;
|
|
|
|
|
|
+ current_file->lineno = yylineno;
|
|
|
file->parent = current_file;
|
|
|
|
|
|
for (iter = current_file; iter; iter = iter->parent) {
|
|
@@ -343,7 +339,7 @@ void zconf_nextfile(const char *name)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- file->lineno = 1;
|
|
|
+ yylineno = 1;
|
|
|
current_file = file;
|
|
|
}
|
|
|
|
|
@@ -352,6 +348,8 @@ static void zconf_endfile(void)
|
|
|
struct buffer *parent;
|
|
|
|
|
|
current_file = current_file->parent;
|
|
|
+ if (current_file)
|
|
|
+ yylineno = current_file->lineno;
|
|
|
|
|
|
parent = current_buf->parent;
|
|
|
if (parent) {
|