aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgrischka <grischka>2015-11-20 18:25:00 +0100
committergrischka <grischka>2015-11-20 18:25:00 +0100
commit8dd185917603f68ffcdc3e98eb39f2497e99d563 (patch)
treea7ee67d17a358c7e88b28598d7fdc7e78ee2815a
parent0b3612631f49ba0c008635aaa46ecf8be2eefcf7 (diff)
downloadtinycc-8dd185917603f68ffcdc3e98eb39f2497e99d563.tar.gz
tinycc-8dd185917603f68ffcdc3e98eb39f2497e99d563.tar.bz2
tccpp: allow .. in token stream
for gas comments lonely on a line such as # .. more stuff where tcc would try to parse .. as a preprocessor directive See also: 0b3612631f49ba0c008635aaa46ecf8be2eefcf7
-rw-r--r--tccpp.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/tccpp.c b/tccpp.c
index 57e1b2e..4dba954 100644
--- a/tccpp.c
+++ b/tccpp.c
@@ -2549,10 +2549,13 @@ maybe_newline:
goto parse_num;
} else if (c == '.') {
PEEKC(c, p);
- if (c != '.')
- expect("'.'");
- PEEKC(c, p);
- tok = TOK_DOTS;
+ if (c == '.') {
+ p++;
+ tok = TOK_DOTS;
+ } else {
+ *--p = '.'; /* may underflow into file->unget[] */
+ tok = '.';
+ }
} else {
tok = '.';
}