aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorov-4 <hausemasterstream@gmail.com>2026-01-29 12:23:18 +0000
committerov-4 <hausemasterstream@gmail.com>2026-01-29 12:23:18 +0000
commit73634b66d412735c292b3941d1281ff0a3c9e5a1 (patch)
tree9f1916dc2263fa001f1db4aa965088e62ed05c38 /lib
parent0f92a54ba91023e7e88d6cabc8f2f78901f62a40 (diff)
Added support for comments using //
Diffstat (limited to 'lib')
-rw-r--r--lib/Lexer/Lexer.cc15
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/Lexer/Lexer.cc b/lib/Lexer/Lexer.cc
index 9ac01d9..c50897b 100644
--- a/lib/Lexer/Lexer.cc
+++ b/lib/Lexer/Lexer.cc
@@ -67,7 +67,20 @@ int Lexer::gettok() {
return tok_eq;
}
- // for comments
+ if (LastChar == '/') {
+ int NextChar = getchar();
+ if (NextChar == '/') {
+ do {
+ LastChar = getchar();
+ } while (LastChar != EOF && LastChar != '\n' && LastChar != '\r');
+
+ if (LastChar != EOF)
+ return gettok();
+ } else {
+ LastChar = NextChar;
+ return '/';
+ }
+ }
if (LastChar == ':') {
LastChar = getchar();