Notes on getting to a working if

This commit is contained in:
Scott Richmond 2022-03-12 14:42:16 -05:00
parent 21bef073d0
commit a05feea32a

View File

@ -452,9 +452,9 @@
- this now works on atoms, collections, synthetics, blocks, and scripts - this now works on atoms, collections, synthetics, blocks, and scripts
- add to everything else: - add to everything else:
- CURRENTLY: - CURRENTLY:
* working on `let`: how to get good error messages here * figure out how to parse `if` with similar strategy to `let`
* previously, the whole expression gets coded as an error (there's only one errror in the errors vector, regardless of the AST representation) * one possibility is to paramterize parse-expr with a sync token:
* what we want is to have each error added to the vector (and just to return a poisoned AST node, whatever the kind) 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. * the strategy here will be the same for the rest of the sequential constructs: `let`, `if`, `import`, `fn`, `loop`, etc.
Other quick thoughts: Other quick thoughts: