ls

simple syscall based programming language from scratch
git clone git://git.kocotian.pl/ls.git
Log | Files | Refs | README

commit 9330cf8eaa9c2f52b9f1cc3b464606716ff3882f
parent 4d6375fab9e420d0fad23ef62075f54382f63b06
Author: kocotian <kocotian@kocotian.pl>
Date:   Mon, 22 Feb 2021 00:06:37 +0100

fixed strings, temporary dump of all tokens for debugging

Diffstat:
Mlsc.c | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lsc.c b/lsc.c @@ -98,7 +98,7 @@ parseline(char *input, size_t ilen, char *output, size_t olen, int lnum, char *f || (type == TokenIdentifier && !ISIDENCHAR(ch)) || (type == TokenString && ISQUOT(ch))) { tokens[tokiter].val = valstart; - tokens[tokiter].len = j; + tokens[tokiter].len = j + (type == TokenString ? 1 : 0); tokens[tokiter++].type = type; if (type != TokenString) --i; type = TokenNull; @@ -106,6 +106,9 @@ parseline(char *input, size_t ilen, char *output, size_t olen, int lnum, char *f } } + for (j = 0; j < tokiter; ++j) + write(1, tokens[j].val, tokens[j].len); + free(tokens); return i; }