Added basics for lexing index expressions

This commit is contained in:
2019-06-05 21:01:59 +02:00
parent 7f79c4d8bb
commit b275e1fbd6
3 changed files with 21 additions and 3 deletions

View File

@@ -65,8 +65,14 @@ IToken* Lexer::LexNext(char c){
return new SimpleToken(TokenKind::OpenParenthesis, this -> _position - 1, 1);
case ')':
return new SimpleToken(TokenKind::CloseParenthesis, this -> _position - 1, 1);
case '[':
return new SimpleToken(TokenKind::OpenSquareBracket, this -> _position - 1, 1);
case ']':
return new SimpleToken(TokenKind::CloseSquareBracket, this -> _position - 1, 1);
case ',':
return new SimpleToken(TokenKind::CommaToken, this -> _position - 1, 1);
case '.':
return new SimpleToken(TokenKind::PeriodToken, this -> _position - 1, 1);
case '=':
if (Lexer::Peek() == '='){
Lexer::Next();