s = input_line_pointer;
if (!startswith (s, "APP\n"))
{
- /* We ignore it. */
- ignore_rest_of_line ();
+ /* We ignore it. Note: Not ignore_rest_of_line ()! */
+ while (s <= buffer_limit)
+ if (is_end_of_line (*s++))
+ break;
+ input_line_pointer = s;
continue;
}
bump_line_counters ();
/* Return pointing just after end-of-line. */
}
-/* Silently advance to the end of line. Use this after already having
+/* Silently advance to the end of a statement. Use this after already having
issued an error about something bad. Like demand_empty_rest_of_line,
this function may leave input_line_pointer one after buffer_limit;
Don't call it from within expression parsing code in an attempt to
ignore_rest_of_line (void)
{
while (input_line_pointer <= buffer_limit)
- if (is_end_of_line[(unsigned char) *input_line_pointer++])
+ if (is_end_of_stmt (*input_line_pointer++))
break;
- /* Return pointing just after end-of-line. */
+ /* Return pointing just after end-of-statement. */
}
/* Sets frag for given symbol to zero_address_frag, except when the
#define is_name_ender(c) \
( lex_type[(unsigned char) (c)] & LEX_END_NAME )
+/* The distinction of "line" and "statement" sadly is blurred by unhelpful
+ naming of e.g. the underlying array. Most users really mean "end of
+ statement". Going forward only these wrappers are supposed to be used. */
+#define is_end_of_stmt(c) \
+ (is_end_of_line[(unsigned char) (c)])
+#define is_end_of_line(c) \
+ (is_end_of_line[(unsigned char) (c)] == 1)
+
#ifndef is_a_char
#define CHAR_MASK (0xff)
#define NOT_A_CHAR (CHAR_MASK+1)
--- /dev/null
+#as:
+#as: -f
+#objdump: -dw --disassemble-zeroes
+#name: generic line comment
+
+.*: +file format .*
+
+Disassembly of section .text:
+
+0+ <(line_comment|\.text)>:
+ +0+: .*
+#pass