/* This is the Assembler Pre-Processor
- Copyright (C) 1987-2016 Free Software Foundation, Inc.
+ Copyright (C) 1987-2021 Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
static const char * symver_state;
#endif
+static char last_char;
+
static char lex[256];
static const char symbol_chars[] =
"$._ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
{
lex['"'] = LEX_IS_STRINGQUOTE;
-#if ! defined (TC_HPPA) && ! defined (TC_I370)
- /* I370 uses single-quotes to delimit integer, float constants. */
+#if ! defined (TC_HPPA)
lex['\''] = LEX_IS_ONECHAR_QUOTE;
#endif
#if defined TC_ARM && defined OBJ_ELF
const char * symver_state;
#endif
+ char last_char;
};
char *
#if defined TC_ARM && defined OBJ_ELF
saved->symver_state = symver_state;
#endif
+ saved->last_char = last_char;
/* do_scrub_begin() is not useful, just wastes time. */
#if defined TC_ARM && defined OBJ_ELF
symver_state = saved->symver_state;
#endif
+ last_char = saved->last_char;
free (arg);
}
state = old_state;
PUT (ch);
}
-#ifndef NO_STRING_ESCAPES
- else if (ch == '\\')
+ else if (TC_STRING_ESCAPES && ch == '\\')
{
state = 6;
PUT (ch);
}
-#endif
else if (scrub_m68k_mri && ch == '\n')
{
/* Just quietly terminate the string. This permits lines like
PUT (ch);
break;
-#ifndef IEEE_STYLE
case LEX_IS_ONECHAR_QUOTE:
#ifdef H_TICK_HEX
if (state == 9 && enable_h_tick_hex)
out_string = out_buf;
PUT (*out_string++);
break;
-#endif
case LEX_IS_COLON:
#ifdef KEEP_WHITE_AROUND_COLON
state = -2;
break;
}
- else
+ else if (ch2 != EOF)
{
UNGET (ch2);
}
goto de_fault;
#endif
-#ifdef TC_ARM
- /* For the ARM, care is needed not to damage occurrences of \@
- by stripping the @ onwards. Yuck. */
- if (to > tostart && *(to - 1) == '\\')
- /* Do not treat the @ as a start-of-comment. */
+ /* Care is needed not to damage occurrences of \<comment-char>
+ by stripping the <comment-char> onwards. Yuck. */
+ if ((to > tostart ? to[-1] : last_char) == '\\')
+ /* Do not treat the <comment-char> as a start-of-comment. */
goto de_fault;
-#endif
#ifdef WARN_COMMENTS
if (!found_comment)
fromeof:
/* We have reached the end of the input. */
+ if (to > tostart)
+ last_char = to[-1];
return to - tostart;
tofull:
else
saved_input = NULL;
+ if (to > tostart)
+ last_char = to[-1];
return to - tostart;
}