Reduce the excessive line directives from macros.
This commit is contained in:
parent
ca920511b9
commit
fe614647c5
|
|
@ -19,7 +19,7 @@
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
#if !defined(WINNT)
|
#if !defined(WINNT)
|
||||||
#ident "$Id: lexor.lex,v 1.8 1999/07/15 03:39:17 steve Exp $"
|
#ident "$Id: lexor.lex,v 1.9 1999/07/15 22:53:47 steve Exp $"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
# include <stdio.h>
|
# include <stdio.h>
|
||||||
|
|
@ -459,6 +459,7 @@ static void do_include()
|
||||||
|
|
||||||
static int yywrap()
|
static int yywrap()
|
||||||
{
|
{
|
||||||
|
int line_mask_flag = 0;
|
||||||
struct include_stack_t*isp = istack;
|
struct include_stack_t*isp = istack;
|
||||||
istack = isp->next;
|
istack = isp->next;
|
||||||
|
|
||||||
|
|
@ -470,8 +471,12 @@ static int yywrap()
|
||||||
/* If I am printing line directives and I just finished
|
/* If I am printing line directives and I just finished
|
||||||
macro substitution, I should terminate the line and
|
macro substitution, I should terminate the line and
|
||||||
arrange for a new directive to be printed. */
|
arrange for a new directive to be printed. */
|
||||||
if (line_direct_flag && istack->path)
|
if (line_direct_flag
|
||||||
|
&& istack && istack->path
|
||||||
|
&& strchr(isp->str, '\n'))
|
||||||
fprintf(yyout, "\n");
|
fprintf(yyout, "\n");
|
||||||
|
else
|
||||||
|
line_mask_flag = 1;
|
||||||
}
|
}
|
||||||
free(isp);
|
free(isp);
|
||||||
|
|
||||||
|
|
@ -480,7 +485,7 @@ static int yywrap()
|
||||||
|
|
||||||
yy_switch_to_buffer(istack->yybs);
|
yy_switch_to_buffer(istack->yybs);
|
||||||
|
|
||||||
if (line_direct_flag && istack->path)
|
if (line_direct_flag && istack->path && !line_mask_flag)
|
||||||
fprintf(yyout, "#line \"%s\" %u\n", istack->path, istack->lineno);
|
fprintf(yyout, "#line \"%s\" %u\n", istack->path, istack->lineno);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue