aboutsummaryrefslogtreecommitdiff
path: root/ld/ldlex.l
diff options
context:
space:
mode:
Diffstat (limited to 'ld/ldlex.l')
-rw-r--r--ld/ldlex.l12
1 files changed, 11 insertions, 1 deletions
diff --git a/ld/ldlex.l b/ld/ldlex.l
index 237892c..7652e8d 100644
--- a/ld/ldlex.l
+++ b/ld/ldlex.l
@@ -385,7 +385,7 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^\\]([*?.$_a-zA-Z0-9\[\]\-\!\^\\]|::)*
yylval.name = xstrdup (yytext + 2);
return LNAME;
}
-<EXPRESSION>{SYMBOLNAMECHAR1}{NOCFILENAMECHAR}* {
+<EXPRESSION>{SYMBOLNAMECHAR1}{SYMBOLNAMECHAR}* {
yylval.name = xstrdup (yytext);
return NAME;
}
@@ -636,6 +636,16 @@ ldlex_popstate (void)
yy_start = *(--state_stack_p);
}
+/* In cases where the parser needs to look ahead and the context
+ changes from expression to script or vice-versa, throw away a
+ NAME. What constitutes a NAME depends on context. */
+
+void
+ldlex_backup (void)
+{
+ yyless (0);
+}
+
/* Return the current file name, or the previous file if no file is
current. */