Greater than and Less Than
Some checks failed
Build / build (push) Failing after 1m12s
Test / build (push) Failing after 11m29s

This commit is contained in:
Chuck Smith
2024-03-18 16:17:13 -04:00
parent d454572870
commit b47a39e1b2
11 changed files with 116 additions and 43 deletions

View File

@@ -84,9 +84,21 @@ func (l *Lexer) NextToken() token.Token {
case '*':
tok = newToken(token.ASTERISK, l.ch)
case '<':
tok = newToken(token.LT, l.ch)
if l.peekChar() == '=' {
l.readChar()
tok = newToken(token.LTE, l.ch)
tok.Literal = "<="
} else {
tok = newToken(token.LT, l.ch)
}
case '>':
tok = newToken(token.GT, l.ch)
if l.peekChar() == '=' {
l.readChar()
tok = newToken(token.GTE, l.ch)
tok.Literal = ">="
} else {
tok = newToken(token.GT, l.ch)
}
case ';':
tok = newToken(token.SEMICOLON, l.ch)
case ',':