Implemented comparison equality operators
This commit is contained in:
@@ -79,6 +79,18 @@ IToken* Lexer::LexNext(char c){
|
||||
return new SimpleToken(TokenKind::EqualityToken, this -> _position - 2, 2);
|
||||
}
|
||||
return new SimpleToken(TokenKind::AssignmentToken, this -> _position - 1, 1);
|
||||
case '<':
|
||||
if (Lexer::Peek() == '='){
|
||||
Lexer::Next();
|
||||
return new SimpleToken(TokenKind::LessEquals, this -> _position - 2, 2);
|
||||
}
|
||||
return new SimpleToken(TokenKind::Less, this -> _position - 1, 1);
|
||||
case '>':
|
||||
if (Lexer::Peek() == '='){
|
||||
Lexer::Next();
|
||||
return new SimpleToken(TokenKind::GreaterEquals, this -> _position - 2, 2);
|
||||
}
|
||||
return new SimpleToken(TokenKind::Greater, this -> _position - 1, 1);
|
||||
case '~':
|
||||
if (Lexer::Peek() == '='){
|
||||
Lexer::Next();
|
||||
|
||||
Reference in New Issue
Block a user