I discovered some more errors when tightening up the lexer rules.
Just because we INCLUDE a file doesn't mean we've switched states.
PR 28217
* ldgram.y (statement): Don't switch lexer state on INCLUDE.
(mri_script_command, ifile_p1, memory_spec, section): Likewise.
| CASE casesymlist
| EXTERN extern_name_list
| INCLUDE filename
- { ldlex_script (); ldfile_open_command_file($2); }
+ { 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
- { ldlex_script (); ldfile_open_command_file($2); }
+ { ldfile_open_command_file ($2); }
ifile_list END
- { ldlex_popstate (); }
| NOCROSSREFS '(' nocrossref_list ')'
{
lang_add_nocrossref ($3);
}
| INCLUDE filename
{
- ldlex_script ();
ldfile_open_command_file ($2);
}
statement_list_opt END
- { ldlex_popstate (); }
;
statement_list:
origin_spec opt_comma length_spec
{}
| INCLUDE filename
- { ldlex_script (); ldfile_open_command_file($2); }
+ { ldfile_open_command_file ($2); }
memory_spec_list_opt END
- { ldlex_popstate (); }
;
origin_spec:
'{' sec_or_group_p1 '}'
| INCLUDE filename
{
- ldlex_script ();
ldfile_open_command_file ($2);
}
sec_or_group_p1 END
- { ldlex_popstate (); }
;
type: