mirror of
https://github.com/RustPython/Parser.git
synced 2025-07-15 00:55:22 +00:00
parent
de7396347f
commit
678b8e779b
1 changed files with 1 additions and 8 deletions
|
@ -1025,14 +1025,7 @@ impl SymbolTableBuilder {
|
|||
let symbol = table.symbols.get_mut(name).unwrap();
|
||||
match role {
|
||||
SymbolUsage::Nonlocal => {
|
||||
if let SymbolScope::Unknown = symbol.scope {
|
||||
symbol.scope = SymbolScope::Nonlocal;
|
||||
} else {
|
||||
return Err(SymbolTableError {
|
||||
error: format!("Symbol {} scope cannot be set to nonlocal, since its scope was already determined otherwise.", name),
|
||||
location,
|
||||
});
|
||||
}
|
||||
symbol.scope = SymbolScope::Nonlocal;
|
||||
}
|
||||
SymbolUsage::Imported => {
|
||||
symbol.is_assigned = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue