about summary refs log tree commit diff
path: root/users/fcuny/exp/monkey/pkg/lexer/lexer_test.go (follow)
Commit message (Collapse)AuthorAgeFilesLines
* ref(users/fcuny): and just like that ...Franck Cuny2022-10-271-125/+0
|
* lexer: support tokens for equal and not equal.franck cuny2020-01-111-0/+13
| | | | | | | | | The tokens for equal (`==`) and not equal (`!=`) are composed of two characters. We introduce a new helper (`peekChar`) that we use when we encounter the token `=` or `!` to see if this is a token composed of two characters. Add some tests to ensure they are parsed correctly.
* lexer: test the new keywords are parsed correctly.franck cuny2020-01-111-3/+25
| | | | | Ensure that the new keywords added (`if`, `else`, `true`, `false`, `return`) are parsed correctly.
* lexer: delete redundant test.franck cuny2020-01-111-32/+1
| | | | | | | The test `TestNextTokenBasic` was not testing anything that `TestNextTokenMonkey` was not already testing. Rename `TestNextTokenMonkey` to `TestNextToken` for clarity.
* lexer: support more operator tokens.franck cuny2020-01-111-1/+18
| | | | | Support the operator tokens that were added to our tokenizer. This also add a few more tests to ensure we handle them correctly.
* lexer: initial lexerfranck cuny2020-01-111-0/+104
The initial lexer for the monkey language. We only support a small subset at this stage. We have some simple tests to ensure that we can parse some small snippet, and that the minimum number of tokens we need are also all supported correctly.