Open
Description
It'd be worth covering
- where the lexer is
- how the parser works
- conventions around error recovery
- - What is this
eat
function?- It consumes a token, and queues up the next token as lookahead
- How do you handle identifiers and keywords?
- What about constructing spans?
- (quoting Niko from below) I have to bring this back into cache, but in general there is this
last_span
thing that stores the span of the last token, and many things follow the idiom of saving the "lo" point of the span, parsing some stuff, then extracting the "hi" point and combining them. This would be used to make a span that encompasses, for example, an entiretrait
definition (the lo point would come from thetrait
keyword, but the end point comes after having parsed a bunch of other things).
- (quoting Niko from below) I have to bring this back into cache, but in general there is this
- What is this crazy pretty printer?
- It dumps out the AST in human readable form.
- We have tests that will parse each file in run-pass, pretty print it, and then test that the resulting pretty printed file type checks, so you have to implement this.
- Something like this: "The parser" #13 (comment) and "The parser" #13 (comment)