diff options
author | Preston Pan <preston@nullring.xyz> | 2023-01-02 22:31:49 -0800 |
---|---|---|
committer | Preston Pan <preston@nullring.xyz> | 2023-01-02 22:31:49 -0800 |
commit | 64feef1b9ea72adf7ba32998e9dca7d507607498 (patch) | |
tree | a409e61877bb51aa6fb2477175dabbf3dbccf298 /src/main.c |
a lot of stuff.
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c new file mode 100644 index 0000000..08cadbc --- /dev/null +++ b/src/main.c @@ -0,0 +1,39 @@ +#define _GNU_SOURCE +#include "./include/lexer.h" +#include "./include/token.h" +#include <stdint.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +int main(int argc, char **argv) { + /* Test Lexer */ + lexer_t *lexer = init_lexer("'(fasd \"aaaaaaaa\" 4)"); + token_t *t = lexer_collect_next(lexer); + while (t != NULL) { + printf("%d: %s\n", t->type, t->value); + t = lexer_collect_next(lexer); + } + /* printf("Welcome to the NXS REPL.\n"); */ + + /* char *buf = malloc(2); */ + /* size_t size = 2; */ + /* lexer_t *lexer; */ + /* lexer = init_lexer("a"); */ + /* token_t *t; */ + /* while (true) { */ + /* printf("> "); */ + /* fflush(stdout); */ + /* getline(&buf, &size, stdin); */ + /* strcat(buf, "\0"); */ + /* lexer_reset(lexer, buf); */ + /* t = lexer_collect_next(lexer); */ + /* while (!lexer->finished) { */ + /* printf("%d\t%s\n", t->type, t->value); */ + /* t = lexer_collect_next(lexer); */ + /* printf("lmao\n"); */ + /* } */ + /* } */ + + return 0; +} |