From 519b13b823f016658b969c45504f55c7a4ff14e6 Mon Sep 17 00:00:00 2001 From: ZZH <76390451+zhangzheheng12345@users.noreply.github.com> Date: Sat, 19 Feb 2022 01:38:30 +0000 Subject: [PATCH] Support multi-line comment --- c4.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/c4.c b/c4.c index 0340255..230fd9a 100644 --- a/c4.c +++ b/c4.c @@ -97,6 +97,12 @@ void next() ++p; while (*p != 0 && *p != '\n') ++p; } + else if(*p == '*') { + ++p; + while(*p != 0 && *(++p) != 0 && (*(p - 1) != '*' || *p != '/')) ++p; + if(*p == 0) printf("%d: lose back wrapping after a multi-line comment\n", line); + else ++p; + } else { tk = Div; return;