diff options
author | Alan Modra <amodra@gmail.com> | 2021-08-13 22:23:40 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2021-08-13 22:30:30 +0930 |
commit | 34a7af0facec33bc4fc327578b829c7e340fc2a8 (patch) | |
tree | 6d38b9e8881388f46ac04fcf708aa7c21e177fae | |
parent | 3bb17dfb6b4f869e2850329be710176b7ff0cb84 (diff) | |
download | gdb-34a7af0facec33bc4fc327578b829c7e340fc2a8.zip gdb-34a7af0facec33bc4fc327578b829c7e340fc2a8.tar.gz gdb-34a7af0facec33bc4fc327578b829c7e340fc2a8.tar.bz2 |
tidy mri script extern
MRI mode generally doesn't flip lexer states, so let's make MRI mode
"extern" not do so either.
* ldgram.y (extern_name_list): Don't change lex state here.
(ifile_p1): Change state here on EXTERN instead.
-rw-r--r-- | ld/ldgram.y | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/ld/ldgram.y b/ld/ldgram.y index 794cf28..24979de 100644 --- a/ld/ldgram.y +++ b/ld/ldgram.y @@ -280,18 +280,12 @@ casesymlist: | casesymlist ',' NAME ; -/* Parsed as expressions so that commas separate entries */ extern_name_list: - { ldlex_expression (); } - extern_name_list_body - { ldlex_popstate (); } - -extern_name_list_body: - NAME + NAME { ldlang_add_undef ($1, false); } - | extern_name_list_body NAME + | extern_name_list NAME { ldlang_add_undef ($2, false); } - | extern_name_list_body ',' NAME + | extern_name_list ',' NAME { ldlang_add_undef ($3, false); } ; @@ -355,7 +349,8 @@ ifile_p1: { lang_add_nocrossref_to ($3); } - | EXTERN '(' extern_name_list ')' + | EXTERN '(' { ldlex_expression (); } extern_name_list ')' + { ldlex_popstate (); } | INSERT_K AFTER NAME { lang_add_insert ($3, 0); } | INSERT_K BEFORE NAME |