diff options
| author | Michael Tews <git@tews.dev> | 2024-06-19 05:30:04 +0200 |
|---|---|---|
| committer | Michael Tews <michael@tews.dev> | 2026-04-12 11:11:01 +0200 |
| commit | 5cc4864ae2c10aa27e9a1d10fe0478f2048f930c (patch) | |
| tree | c6194c0ffc0e263d1989f9d48222c0bd3e6657fc /lexer | |
| parent | 5c3c7deb46ec17051906142ac37a096345a60a8a (diff) | |
feat(lexer): added tokens and updated NextToken() with the tokens
adds =,+,-,!,*,/ tokens
Diffstat (limited to 'lexer')
| -rw-r--r-- | lexer/lexer.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lexer/lexer.go b/lexer/lexer.go index 92722f6..cdd2901 100644 --- a/lexer/lexer.go +++ b/lexer/lexer.go @@ -37,6 +37,18 @@ func (l *Lexer) NextToken() token.Token { tok = newToken(token.COMMA, l.ch) case '+': tok = newToken(token.PLUS, l.ch) + case '-': + tok = newToken(token.MINUS, l.ch) + case '!': + tok = newToken(token.BANG, l.ch) + case '*': + tok = newToken(token.ASTERISK, l.ch) + case '/': + tok = newToken(token.SLASH, l.ch) + case '<': + tok = newToken(token.LT, l.ch) + case '>': + tok = newToken(token.GT, l.ch) case 0: tok.Literal = "" tok.Type = token.EOF |
