mirror of
https://github.com/RustPython/Parser.git
synced 2025-07-24 21:44:45 +00:00
add arg_name in duplicate argument error msg
This commit is contained in:
parent
63e4a36e27
commit
41f21a7b5d
2 changed files with 6 additions and 6 deletions
|
@ -21,7 +21,7 @@ pub enum LexicalErrorType {
|
|||
TabError,
|
||||
TabsAfterSpaces,
|
||||
DefaultArgumentError,
|
||||
DuplicateArgumentError,
|
||||
DuplicateArgumentError(String),
|
||||
PositionalArgumentError,
|
||||
UnpackedArgumentError,
|
||||
DuplicateKeywordArgumentError,
|
||||
|
@ -51,8 +51,8 @@ impl fmt::Display for LexicalErrorType {
|
|||
LexicalErrorType::DefaultArgumentError => {
|
||||
write!(f, "non-default argument follows default argument")
|
||||
}
|
||||
LexicalErrorType::DuplicateArgumentError => {
|
||||
write!(f, "duplicate argument in function definition")
|
||||
LexicalErrorType::DuplicateArgumentError(arg_name) => {
|
||||
write!(f, "duplicate argument '{arg_name}' in function definition")
|
||||
}
|
||||
LexicalErrorType::DuplicateKeywordArgumentError => {
|
||||
write!(f, "keyword argument repeated")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue