add arg_name in duplicate argument error msg

This commit is contained in:
Nick Liu 2022-12-29 21:39:38 +08:00
parent 63e4a36e27
commit 41f21a7b5d
2 changed files with 6 additions and 6 deletions

View file

@ -31,16 +31,16 @@ pub fn validate_arguments(
let mut all_arg_names =
FxHashSet::with_hasher(Default::default());
for arg in all_args {
let arg_name = arg.node.arg.clone();
let arg_name = &arg.node.arg;
if !all_arg_names.insert(arg_name) {
return Err(LexicalError {
error: LexicalErrorType::DuplicateArgumentError,
error: LexicalErrorType::DuplicateArgumentError(arg_name.to_string()),
location: arg.location,
});
}
}
return Ok(arguments);
Ok(arguments)
}
pub fn parse_params(