Bitshift
This commit is contained in:
@@ -116,6 +116,11 @@ func (l *Lexer) NextToken() token.Token {
|
||||
l.readChar()
|
||||
tok = newToken(token.LTE, l.ch)
|
||||
tok.Literal = "<="
|
||||
} else if l.peekChar() == '<' {
|
||||
ch := l.ch
|
||||
l.readChar()
|
||||
literal := string(ch) + string(l.ch)
|
||||
tok = token.Token{Type: token.LEFT_SHIFT, Literal: literal}
|
||||
} else {
|
||||
tok = newToken(token.LT, l.ch)
|
||||
}
|
||||
@@ -124,6 +129,11 @@ func (l *Lexer) NextToken() token.Token {
|
||||
l.readChar()
|
||||
tok = newToken(token.GTE, l.ch)
|
||||
tok.Literal = ">="
|
||||
} else if l.peekChar() == '>' {
|
||||
ch := l.ch
|
||||
l.readChar()
|
||||
literal := string(ch) + string(l.ch)
|
||||
tok = token.Token{Type: token.RIGHT_SHIFT, Literal: literal}
|
||||
} else {
|
||||
tok = newToken(token.GT, l.ch)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user