bug fixes

This commit is contained in:
Leo
2024-04-10 18:46:48 +02:00
parent a689c04122
commit 84397b05d0
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -60,8 +60,9 @@ impl Parser {
let token = &self.tokens[index];
match token.token_type {
TokenType::Identifier => {
ast_res.tokens.push(self.tokens[index].clone());
self.index += 1;
if self.tokens.len()-index > 3 && self.tokens[index+1].token_type==TokenType::Identifier && self.tokens[index+2].token_type==TokenType::Round && self.tokens[index+3].token_type==TokenType::Curly {
ast_res.tokens.push(self.tokens[index].clone());
ast_res.tokens.push(self.tokens[index+1].clone());
ast_res.tokens.push(self.tokens[index+2].clone());
ast_res.tokens.push(self.tokens[index+3].clone());