Implements inequality token

This commit is contained in:
2019-05-25 14:17:52 +02:00
parent d6a6e116fe
commit 9131fbfee7
8 changed files with 39 additions and 2 deletions

View File

@@ -62,6 +62,13 @@ 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::InequalityToken, this -> Position - 2, 2);
}
this -> ScriptData -> Diagnostics -> LogError(DiagnosticCode::UnexpectedCharacter, this -> Position - 1, 1);
return new SimpleToken(TokenKind::BadToken, this -> Position - 1, 1);
case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9':
return LexNumber(c);
case '"':