From a05feea32ae2629b034d17b599314a436ff8145a Mon Sep 17 00:00:00 2001 From: Scott Richmond Date: Sat, 12 Mar 2022 14:42:16 -0500 Subject: [PATCH] Notes on getting to a working `if` --- src/ludus/parser.clj | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ludus/parser.clj b/src/ludus/parser.clj index 1852b99..52d0fec 100644 --- a/src/ludus/parser.clj +++ b/src/ludus/parser.clj @@ -452,9 +452,9 @@ - this now works on atoms, collections, synthetics, blocks, and scripts - add to everything else: - CURRENTLY: - * working on `let`: how to get good error messages here - * previously, the whole expression gets coded as an error (there's only one errror in the errors vector, regardless of the AST representation) - * what we want is to have each error added to the vector (and just to return a poisoned AST node, whatever the kind) + * figure out how to parse `if` with similar strategy to `let` + * one possibility is to paramterize parse-expr with a sync token: + the idea here is that exprs will have different end sync points in different contexts (`}` vs `then` vs `\n`, etc.) * the strategy here will be the same for the rest of the sequential constructs: `let`, `if`, `import`, `fn`, `loop`, etc. Other quick thoughts: