Modify nonlocal to be declared multiple times

Related to #2183
This commit is contained in:
minoring committed 2020-09-05 22:42:52 +09:00
1 parent 4a0ee1d253
commit dadf430c75
1 file changed
+1 -8
+1 -8
View File
@@ -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;