From c871db694f849075dd3f6637abd424272f112af5 Mon Sep 17 00:00:00 2001 From: Ákos Kőrösi Date: Mon, 18 May 2026 12:07:40 +0200 Subject: adjust parsing for the lex redesign --- main.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index a3fb4ec..923fa68 100644 --- a/main.c +++ b/main.c @@ -21,11 +21,16 @@ int main() { .chunks = make_ChunkVec(256), .regions = make_RegionVec(256), }; - TokenPtrVec line_toks = lex(line, &arena); - /* - Pipeline pl = parse_tokstream(res.top_tokens); + TokenPtrVec line_tok_ptrs = lex(line, &arena); + Token* tokstream = malloc(sizeof(Token) * line_tok_ptrs.count); + for (int i = 0; i < line_tok_ptrs.count; i++) { + tokstream[i] = **get_from_TokenPtrVec(&line_tok_ptrs, i); + } + Pipeline pl = parse_tokstream(tokstream); + /* run_pipeline(pl, &shstate); */ + free(tokstream); } free(line); } -- cgit v1.2.3