diff options
author | kdx <kikoodx@paranoici.org> | 2023-06-09 20:18:09 +0200 |
---|---|---|
committer | kdx <kikoodx@paranoici.org> | 2023-06-09 20:18:09 +0200 |
commit | cfc5d381a00fdbd812396c3c4e67616cfa669223 (patch) | |
tree | a7f79dac8926103b8abff0d4ed0991b26122f66f | |
parent | a82211bc77beb8ee7469f08a568481157ea56f6c (diff) | |
download | golem-cfc5d381a00fdbd812396c3c4e67616cfa669223.tar.gz |
char literal
-rw-r--r-- | src/main.c | 7 | ||||
-rwxr-xr-x | testing.sh | 5 |
2 files changed, 10 insertions, 2 deletions
@@ -109,6 +109,13 @@ tokenize(char *p) continue; } + if (*p == '\'' && p[1] != '\0' && p[2] == '\'') { + cur = cur->next = new_token(TOK_NUM, p, p + 3); + cur->val = (unsigned char)*p; + p += 3; + continue; + } + const int punct = is_punct(p); if (punct) { cur = cur->next = new_token(TOK_PUNCT, p, p + punct); @@ -9,6 +9,7 @@ function test() { } tup || exit 1 -test '5 + 2;' -test '6 + 3;' +test "5 + 2;" +test "6 + 3;" +test "'a' - 'b';" rm -f build/tmp.* |