- /* This is neet. Turn "string
- more string" into "string\n more string"
- */
- case '\n':
- (*unget) ('n');
- add_newlines++;
- return '\\';
-
- case '"':
- case '\\':
- case 'b':
- case 'f':
- case 'n':
- case 'r':
- case 't':
-#ifdef BACKSLASH_V
- case 'v':
-#endif /* BACKSLASH_V */
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- break;
-#if defined(IGNORE_NONSTANDARD_ESCAPES) | defined(ONLY_STANDARD_ESCAPES)
- default:
- as_warn ("Unknown escape '\\%c' in string: Ignored", ch);
- break;
-#else /* ONLY_STANDARD_ESCAPES */
- default:
- /* Accept \x as x for any x */
+ if (state != 0)
+ {
+ as_warn (_("end of file not at end of a line; newline inserted"));
+ state = 0;
+ PUT ('\n');
+ }
+ goto fromeof;
+ }
+
+ switch (lex[ch])
+ {
+ case LEX_IS_WHITESPACE:
+ do
+ {
+ ch = GET ();
+ }
+ while (ch != EOF && IS_WHITESPACE (ch));
+ if (ch == EOF)
+ goto fromeof;
+
+ if (state == 0)
+ {
+ /* Preserve a single whitespace character at the
+ beginning of a line. */
+ state = 1;
+ UNGET (ch);
+ PUT (' ');
+ break;
+ }
+
+#ifdef KEEP_WHITE_AROUND_COLON
+ if (lex[ch] == LEX_IS_COLON)
+ {
+ /* Only keep this white if there's no white *after* the
+ colon. */
+ ch2 = GET ();
+ if (ch2 != EOF)
+ UNGET (ch2);
+ if (!IS_WHITESPACE (ch2))
+ {
+ state = 9;
+ UNGET (ch);
+ PUT (' ');
+ break;
+ }
+ }
+#endif
+ if (IS_COMMENT (ch)
+ || ch == '/'
+ || IS_LINE_SEPARATOR (ch)
+ || IS_PARALLEL_SEPARATOR (ch))
+ {
+ if (scrub_m68k_mri)
+ {
+ /* In MRI mode, we keep these spaces. */
+ UNGET (ch);
+ PUT (' ');
+ break;
+ }
+ goto recycle;
+ }
+
+ /* If we're in state 2 or 11, we've seen a non-white
+ character followed by whitespace. If the next character
+ is ':', this is whitespace after a label name which we
+ normally must ignore. In MRI mode, though, spaces are
+ not permitted between the label and the colon. */
+ if ((state == 2 || state == 11)
+ && lex[ch] == LEX_IS_COLON
+ && ! scrub_m68k_mri)
+ {
+ state = 1;
+ PUT (ch);
+ break;
+ }
+
+ switch (state)
+ {
+ case 1:
+ /* We can arrive here if we leave a leading whitespace
+ character at the beginning of a line. */
+ goto recycle;
+ case 2:
+ state = 3;
+ if (to + 1 < toend)
+ {
+ /* Optimize common case by skipping UNGET/GET. */
+ PUT (' '); /* Sp after opco */
+ goto recycle;
+ }
+ UNGET (ch);
+ PUT (' ');
+ break;
+ case 3:
+#ifndef TC_KEEP_OPERAND_SPACES
+ /* For TI C6X, we keep these spaces as they may separate
+ functional unit specifiers from operands. */
+ if (scrub_m68k_mri)
+#endif
+ {
+ /* In MRI mode, we keep these spaces. */
+ UNGET (ch);
+ PUT (' ');
+ break;
+ }
+ goto recycle; /* Sp in operands */
+ case 9:
+ case 10:
+#ifndef TC_KEEP_OPERAND_SPACES
+ if (scrub_m68k_mri)
+#endif
+ {
+ /* In MRI mode, we keep these spaces. */
+ state = 3;
+ UNGET (ch);
+ PUT (' ');
+ break;
+ }
+ state = 10; /* Sp after symbol char */
+ goto recycle;
+ case 11:
+ if (LABELS_WITHOUT_COLONS || flag_m68k_mri)
+ state = 1;
+ else
+ {
+ /* We know that ch is not ':', since we tested that
+ case above. Therefore this is not a label, so it
+ must be the opcode, and we've just seen the
+ whitespace after it. */
+ state = 3;
+ }
+ UNGET (ch);
+ PUT (' '); /* Sp after label definition. */
+ break;
+ default:
+ BAD_CASE (state);
+ }