Implemented comparison equality operators

This commit is contained in:
2019-06-08 15:38:08 +02:00
parent fc66c15c2f
commit 7d75131822
10 changed files with 274 additions and 0 deletions

View File

@@ -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();