From c921a9f9cde39c2362ff45204bb929d2f0d9146d Mon Sep 17 00:00:00 2001 From: lcw Date: Wed, 30 Aug 2023 16:41:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8D=95=E8=A1=8C=E6=B3=A8?= =?UTF-8?q?=E9=87=8A=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/scan.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/scan.cpp b/src/scan.cpp index d5a54eb..81c0561 100644 --- a/src/scan.cpp +++ b/src/scan.cpp @@ -52,6 +52,13 @@ vector scan(string s) { } else { printf("error on line %d", line), exit(1); } + } else if (s[pt] == '/') { + if (pt + 1 < s.size() && s[pt + 1] == '/') { + for (pt += 2; pt < s.size() && s[pt] != '\n'; pt++) {} + continue; + } else { + printf("error on line %d", line), exit(1); + } } else if (isalpha(s[pt]) || s[pt] == '_') { size_t r = pt + 1; while (r < s.size() && (isalpha(s[r]) || s[r] == '_' || isdigit(s[r]))) {