Parser - Fixed parameter parsing bug

This commit is contained in:
Emmanuel BENOîT 2023-01-08 12:00:01 +01:00
parent e963868aa7
commit 20aa06ac25

View file

@ -276,8 +276,8 @@ impl Parser {
if names.contains(&name.lexeme) { if names.contains(&name.lexeme) {
return self.error_mv(format!("duplicate {} parameter", kind.name())); return self.error_mv(format!("duplicate {} parameter", kind.name()));
} }
names.insert(name.lexeme); names.insert(name.lexeme.clone());
params.push(self.advance().clone()); params.push(name);
if self.expect(&[TokenType::Comma]).is_none() { if self.expect(&[TokenType::Comma]).is_none() {
break; break;
} }