Closed snakeru closed 7 years ago
Just in case my 'Done' comments already propagated to you: please bare with me, it's the first time I use github for code reviews. I am currently researching what is the proper way to git commit --amend here.
Just in case my 'Done' comments already propagated to you: please bare with me, it's the first time I use github for code reviews.
No problem and thanks for the PR!
I amended my commit and did a force-push (hopefully that's the right way to do it - I was not able to find a clear instruction how to make changes and keep just a single commit). Please take another look. The correct commit is bf73...
Thank you for the TokenBytes() hint! I was able to delete a few lines.
Thanks! Done.
Thank you!
This example uses the lex.Lexer instead of a custom one. The reasons for the pull are two-fold: 1) There is no lexer+parser example for the languages with keywords yet. The most evolved example (calc) uses only operations and numbers, no keywords 2) Ability to mark the lexed candidate and then unread bytes on abort. I have lost the whole day before I realized what the problem was (the calc example is too primitive). Hopefully someone else will use my example. Specifically I was trying to parse a C-like language that features divisions (single slash) and comments until end of the line (double slash).