From cd20e8bb36f6ef65bea0e062c66867cb80568152 Mon Sep 17 00:00:00 2001 From: kdx Date: Tue, 13 Jun 2023 15:38:48 +0200 Subject: =?UTF-8?q?comment=20with=20=F0=9F=97=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- samples/helloworld.golem | 2 +- src/main.c | 13 ++++--------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/samples/helloworld.golem b/samples/helloworld.golem index 57333b5..24a84de 100644 --- a/samples/helloworld.golem +++ b/samples/helloworld.golem @@ -7,7 +7,7 @@ main() { strcpy(str, "Hello, World!\n"); - i = 0; + i = 0; 🗿 loop variable loop { i++; if (i > iterations) diff --git a/src/main.c b/src/main.c index a76d098..622ced0 100644 --- a/src/main.c +++ b/src/main.c @@ -130,20 +130,15 @@ tokenize(char *p) Token *cur = &head; while (*p != '\0') { - if (*p == '/' && p[1] == '/') { + /* comment */ + if (strncmp(p, "//", 2) == 0 || + strncmp(p, "🗿", strlen("🗿")) == 0) + { while (*p != '\0' && *p != '\n') p++; continue; } - if (*p == '#') { - char *q = p + 1; - while (*p != '\n' && *p != '\0') { - p += 1; - } - printf("%.*s\n", (int)(p - q), q); - } - if (isspace(*p)) { p++; continue; -- cgit v1.2.3