Finish implementing the lexer
yberreby opened this issue · comments
Remaining work:
- rune literals
- floating-point literals
- imaginary literals
- hexadecimal integer literals
- octal integer literals
- adding back unit tests - they were removed at some point because of breaking changes
When should strings be actually interpreted?
I added some tests to lexer.rs: https://github.com/yberreby/rgo/blob/master/src/lexer/mod.rs#L695
I think it's better to interpret strings during parsing. Here's the relevant section of the parser.
Oh, and thank you very much for your contributions :)
I fear you may have introduced an infinite loop, though, because the integration tests are hanging indefinitely since your change.
Oh, I found the problem!
I think it might be a good idea to use GitHub PRs instead of pushing directly to master for non-trivial changes, so that this kind of change stands out and can be discussed in the GitHub UI.
Yup, I will next time.
So what needs to be done for interpreted strings in the lexer?
Well... nothing at all, it seems. It's in the parser that they must be interpreted so my checklist item was wrong.
Didn't you just say that should be done in the parser?
Yes I did, I accidentally hit "comment" before realizing that belonged to the parser. Reload to see my edit, and sorry.