+2001-10-20 Alan Modra <amodra@bigpond.net.au>
+
+ * ldgram.y (mri_script_command): Surround processing of INCLUDE
+ with ldlex_script, ldlex_popstate.
+ (ifile_p1): Likewise.
+ * ldlex.l (EOF): Don't BEGIN(SCRIPT). Restore lineno from the
+ correct slot.
+ (lex_push_file): Save current lineno to lineno_stack. Set lineno
+ to 1. Don't BEGIN(SCRIPT).
+ (lex_redirect): Similarly.
+ * ldmain.c (main): Set yydebug non-zero if YYDEBUG.
+
2001-10-20 Nick Clifton <nickc@cambridge.redhat.com>
* scripttempl/armcoff.sc: Define __EH_FRAME_BEGIN__ and
| CASE casesymlist
| EXTERN extern_name_list
| INCLUDE filename
- { ldfile_open_command_file ($2); } mri_script_lines END
+ { ldlex_script (); ldfile_open_command_file($2); }
+ mri_script_lines END
+ { ldlex_popstate (); }
| START NAME
{ lang_add_entry ($2, false); }
|
| MAP '(' filename ')'
{ lang_add_map($3); }
| INCLUDE filename
- { ldfile_open_command_file($2); } ifile_list END
+ { ldlex_script (); ldfile_open_command_file($2); }
+ ifile_list END
+ { ldlex_popstate (); }
| NOCROSSREFS '(' nocrossref_list ')'
{
lang_add_nocrossref ($3);
else
{
yy_switch_to_buffer(include_stack[include_stack_ptr]);
-
}
- BEGIN(SCRIPT);
+
ldfile_input_filename = file_name_stack[include_stack_ptr - 1];
- lineno = lineno_stack[include_stack_ptr - 1];
+ lineno = lineno_stack[include_stack_ptr];
return END;
}
einfo("%F:includes nested too deeply\n");
}
file_name_stack[include_stack_ptr] = name;
- lineno_stack[include_stack_ptr] = 1;
+ lineno_stack[include_stack_ptr] = lineno;
include_stack[include_stack_ptr] = YY_CURRENT_BUFFER;
include_stack_ptr++;
+ lineno = 1;
yyin = file;
yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE));
- BEGIN (SCRIPT);
}
/* Return a newly created flex input buffer containing STRING,
einfo("%F: macros nested too deeply\n");
}
file_name_stack[include_stack_ptr] = "redirect";
- lineno_stack[include_stack_ptr] = 0;
+ lineno_stack[include_stack_ptr] = lineno;
include_stack[include_stack_ptr] = YY_CURRENT_BUFFER;
include_stack_ptr++;
+ lineno = 1;
tmp = yy_create_string_buffer (string, strlen (string));
yy_switch_to_buffer (tmp);
- BEGIN (SCRIPT);
}
\f
/* Functions to switch to a different flex start condition,