mirror of
https://github.com/RustPython/Parser.git
synced 2025-07-15 17:15:24 +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();
|
let symbol = table.symbols.get_mut(name).unwrap();
|
||||||
match role {
|
match role {
|
||||||
SymbolUsage::Nonlocal => {
|
SymbolUsage::Nonlocal => {
|
||||||
if let SymbolScope::Unknown = symbol.scope {
|
symbol.scope = SymbolScope::Nonlocal;
|
||||||
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,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
SymbolUsage::Imported => {
|
SymbolUsage::Imported => {
|
||||||
symbol.is_assigned = true;
|
symbol.is_assigned = true;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue