#define IS_PARALLEL_SEPARATOR(c) (lex[c] == LEX_IS_PARALLEL_SEPARATOR)
#define IS_COMMENT(c) (lex[c] == LEX_IS_COMMENT_START)
#define IS_LINE_COMMENT(c) (lex[c] == LEX_IS_LINE_COMMENT_START)
+#define IS_TWOCHAR_COMMENT_1ST(c) (lex[c] == LEX_IS_TWOCHAR_COMMENT_1ST)
#define IS_NEWLINE(c) (lex[c] == LEX_IS_NEWLINE)
static char lex[256] = {
for (p = tc_comment_chars; *p; p++)
lex[(unsigned char) *p] = LEX_IS_COMMENT_START;
+ /* While counter intuitive to have more special purpose line comment chars
+ override more general purpose ordinary ones, logic in do_scrub_chars()
+ depends on this ordering. */
for (p = line_comment_chars; *p; p++)
lex[(unsigned char) *p] = LEX_IS_LINE_COMMENT_START;
}
}
#endif
+
+ /* Prune trailing whitespace. */
if (IS_COMMENT (ch)
+ || (IS_LINE_COMMENT (ch)
+ && (state < 1 || strchr (tc_comment_chars, ch)))
+ || IS_NEWLINE (ch)
|| IS_LINE_SEPARATOR (ch)
|| IS_PARALLEL_SEPARATOR (ch))
{
}
goto recycle;
}
+#ifdef DOUBLESLASH_LINE_COMMENTS
+ if (IS_TWOCHAR_COMMENT_1ST (ch))
+ {
+ ch2 = GET ();
+ if (ch2 != EOF)
+ UNGET (ch2);
+ if (ch2 == '/')
+ goto recycle;
+ }
+#endif
/* If we're in state 2 or 11, we've seen a non-white
character followed by whitespace. If the next character
@section Comments
@cindex comments
-There are two ways of rendering comments to @command{@value{AS}}. In both
-cases the comment is equivalent to one space.
+There are two ways of rendering comments to @command{@value{AS}}.
Anything from @samp{/*} through the next @samp{*/} is a comment.
-This means you may not nest these comments.
+This means you may not nest these comments. Such a comment is equivalent to
+one space, plus bumping the line counter accordingly.
@smallexample
/*
.*:50: Warning: extended operand requested but not required
.*:51: Error: opcode not supported on this processor: mips1 \(mips1\) `restore\.e 128'
.*:52: Error: opcode not supported on this processor: mips1 \(mips1\) `save\.e 128'
-.*:53: Error: unrecognized extended version of MIPS16 opcode `nop\.e '
+.*:53: Error: unrecognized extended version of MIPS16 opcode `nop\.e'
.*:54: Error: unrecognized extended version of MIPS16 opcode `move\.e \$0,\$16'
.*:55: Error: unrecognized extended version of MIPS16 opcode `move\.e \$16,\$0'
.*:57: Warning: extended operand requested but not required
.*:123: Error: unrecognized extended version of MIPS16 opcode `srav\.e \$16,\$16'
.*:124: Error: operand 2 must be an immediate expression `sra\.e \$16,\$16'
.*:125: Error: opcode not supported on this processor: mips1 \(mips1\) `dsrl\.e \$16,8'
-.*:126: Error: unrecognized extended version of MIPS16 opcode `entry\.e '
+.*:126: Error: unrecognized extended version of MIPS16 opcode `entry\.e'
.*:127: Error: unrecognized extended version of MIPS16 opcode `entry\.e \$31'
.*:128: Error: unrecognized extended version of MIPS16 opcode `exit\.e \$f0'
.*:129: Error: unrecognized extended version of MIPS16 opcode `exit\.e'
.*:50: Warning: extended operand requested but not required
.*:51: Error: opcode not supported on this processor: mips3 \(mips3\) `restore\.e 128'
.*:52: Error: opcode not supported on this processor: mips3 \(mips3\) `save\.e 128'
-.*:53: Error: unrecognized extended version of MIPS16 opcode `nop\.e '
+.*:53: Error: unrecognized extended version of MIPS16 opcode `nop\.e'
.*:54: Error: unrecognized extended version of MIPS16 opcode `move\.e \$0,\$16'
.*:55: Error: unrecognized extended version of MIPS16 opcode `move\.e \$16,\$0'
.*:57: Warning: extended operand requested but not required
.*:123: Error: unrecognized extended version of MIPS16 opcode `srav\.e \$16,\$16'
.*:124: Error: operand 2 must be an immediate expression `sra\.e \$16,\$16'
.*:125: Warning: extended operand requested but not required
-.*:126: Error: unrecognized extended version of MIPS16 opcode `entry\.e '
+.*:126: Error: unrecognized extended version of MIPS16 opcode `entry\.e'
.*:127: Error: unrecognized extended version of MIPS16 opcode `entry\.e \$31'
.*:128: Error: unrecognized extended version of MIPS16 opcode `exit\.e \$f0'
.*:129: Error: unrecognized extended version of MIPS16 opcode `exit\.e'
.*:48: Warning: extended operand requested but not required
.*:49: Warning: extended operand requested but not required
.*:50: Warning: extended operand requested but not required
-.*:53: Error: unrecognized extended version of MIPS16 opcode `nop\.e '
+.*:53: Error: unrecognized extended version of MIPS16 opcode `nop\.e'
.*:54: Error: unrecognized extended version of MIPS16 opcode `move\.e \$0,\$16'
.*:55: Error: unrecognized extended version of MIPS16 opcode `move\.e \$16,\$0'
.*:57: Warning: extended operand requested but not required
.*:123: Error: unrecognized extended version of MIPS16 opcode `srav\.e \$16,\$16'
.*:124: Error: operand 2 must be an immediate expression `sra\.e \$16,\$16'
.*:125: Warning: extended operand requested but not required
-.*:126: Error: unrecognized extended version of MIPS16 opcode `entry\.e '
+.*:126: Error: unrecognized extended version of MIPS16 opcode `entry\.e'
.*:127: Error: unrecognized extended version of MIPS16 opcode `entry\.e \$31'
.*:128: Error: unrecognized extended version of MIPS16 opcode `exit\.e \$f0'
.*:129: Error: unrecognized extended version of MIPS16 opcode `exit\.e'
.*:48: Warning: extended operand requested but not required
.*:49: Warning: extended operand requested but not required
.*:50: Warning: extended operand requested but not required
-.*:53: Error: unrecognized extended version of MIPS16 opcode `nop\.e '
+.*:53: Error: unrecognized extended version of MIPS16 opcode `nop\.e'
.*:54: Error: unrecognized extended version of MIPS16 opcode `move\.e \$0,\$16'
.*:55: Error: unrecognized extended version of MIPS16 opcode `move\.e \$16,\$0'
.*:57: Warning: extended operand requested but not required
.*:123: Error: unrecognized extended version of MIPS16 opcode `srav\.e \$16,\$16'
.*:124: Error: operand 2 must be an immediate expression `sra\.e \$16,\$16'
.*:125: Error: opcode not supported on this processor: mips32 \(mips32\) `dsrl\.e \$16,8'
-.*:126: Error: unrecognized extended version of MIPS16 opcode `entry\.e '
+.*:126: Error: unrecognized extended version of MIPS16 opcode `entry\.e'
.*:127: Error: unrecognized extended version of MIPS16 opcode `entry\.e \$31'
.*:128: Error: unrecognized extended version of MIPS16 opcode `exit\.e \$f0'
.*:129: Error: unrecognized extended version of MIPS16 opcode `exit\.e'
.*:48: Warning: extended operand requested but not required
.*:49: Warning: extended operand requested but not required
.*:50: Warning: extended operand requested but not required
-.*:53: Error: unrecognized extended version of MIPS16 opcode `nop\.e '
+.*:53: Error: unrecognized extended version of MIPS16 opcode `nop\.e'
.*:54: Error: unrecognized extended version of MIPS16 opcode `move\.e \$0,\$16'
.*:55: Error: unrecognized extended version of MIPS16 opcode `move\.e \$16,\$0'
.*:57: Warning: extended operand requested but not required
.*:123: Error: unrecognized extended version of MIPS16 opcode `srav\.e \$16,\$16'
.*:124: Error: operand 2 must be an immediate expression `sra\.e \$16,\$16'
.*:125: Error: opcode not supported on this processor: mips32r2 \(mips32r2\) `dsrl\.e \$16,8'
-.*:126: Error: unrecognized extended version of MIPS16 opcode `entry\.e '
+.*:126: Error: unrecognized extended version of MIPS16 opcode `entry\.e'
.*:127: Error: unrecognized extended version of MIPS16 opcode `entry\.e \$31'
.*:128: Error: unrecognized extended version of MIPS16 opcode `exit\.e \$f0'
.*:129: Error: unrecognized extended version of MIPS16 opcode `exit\.e'
.*:48: Warning: extended operand requested but not required
.*:49: Warning: extended operand requested but not required
.*:50: Warning: extended operand requested but not required
-.*:53: Error: unrecognized extended version of MIPS16 opcode `nop\.e '
+.*:53: Error: unrecognized extended version of MIPS16 opcode `nop\.e'
.*:54: Error: unrecognized extended version of MIPS16 opcode `move\.e \$0,\$16'
.*:55: Error: unrecognized extended version of MIPS16 opcode `move\.e \$16,\$0'
.*:57: Warning: extended operand requested but not required
.*:123: Error: unrecognized extended version of MIPS16 opcode `srav\.e \$16,\$16'
.*:124: Error: operand 2 must be an immediate expression `sra\.e \$16,\$16'
.*:125: Error: opcode not supported on this processor: interaptiv-mr2 \(mips32r3\) `dsrl\.e \$16,8'
-.*:126: Error: unrecognized extended version of MIPS16 opcode `entry\.e '
+.*:126: Error: unrecognized extended version of MIPS16 opcode `entry\.e'
.*:127: Error: unrecognized extended version of MIPS16 opcode `entry\.e \$31'
.*:128: Error: unrecognized extended version of MIPS16 opcode `exit\.e \$f0'
.*:129: Error: unrecognized extended version of MIPS16 opcode `exit\.e'