Commit 023d162f authored by Michaël Cadilhac's avatar Michaël Cadilhac
Browse files

2005-06-09 Michael Cadilhac <michael.cadilhac@lrde.epita.fr>

	* parser.y: Do not output "#line" directives when reading rules.
parent bbc776e7
2005-06-09 Michael Cadilhac <michael.cadilhac@lrde.epita.fr>
* parser.y: Do not output "#line" directives when reading rules.
2005-06-09 Michael Cadilhac <michael.cadilhac@lrde.epita.fr>
* parser.y: Search through `include_dirs' paths for file to include.
......
......@@ -107,6 +107,8 @@ optcfunc : /*empty */ { $$ = NULL; }
static char input[2048];
static char *next = input;
static int n_input = 0;
static int state = 0;
char *fgets_inc(char *s, int size)
{
......@@ -123,9 +125,10 @@ char *fgets_inc(char *s, int size)
return 0;
free (inputs[n_input].filename);
fclose (inputs[n_input--].fd);
fprintf (outputfd, "#line %d \"%s\"\n",
inputs[n_input].yylineno + 1,
inputs[n_input].filename);
if (state != 1)
fprintf (outputfd, "#line %d \"%s\"\n",
inputs[n_input].yylineno + 1,
inputs[n_input].filename);
return fgets_inc(s, size);
}
......@@ -150,7 +153,8 @@ char *fgets_inc(char *s, int size)
if (b_found == FALSE)
yyerror ("`%%include %s': %s",
filename, strerror(errno));
fprintf (outputfd, "#line %d \"%s\"\n", 1, path);
if (state != 1)
fprintf (outputfd, "#line %d \"%s\"\n", 1, path);
inputs[++n_input].yylineno = 0;
inputs[n_input].filename = strdup (path);
return fgets_inc(s, size);
......@@ -175,8 +179,6 @@ yyerror (char *fmt, ...)
exit (-1);
}
static int state = 0;
void
reset_parser ()
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment