-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Labels
C-compatA discrepancy between RustPython and CPythonA discrepancy between RustPython and CPython
Description
Feature
The variable is_param is declared in symbol struct, but the parameter is checked only with the is_parameter.
Deleting the unused is_param variable seems to improve readability.
RustPython/compiler/src/symboltable.rs
Lines 94 to 103 in 6dccc98
| pub struct Symbol { | |
| pub name: String, | |
| // pub table: SymbolTableRef, | |
| pub scope: SymbolScope, | |
| pub is_param: bool, | |
| pub is_referenced: bool, | |
| pub is_assigned: bool, | |
| pub is_parameter: bool, | |
| pub is_free: bool, | |
| } |
RustPython/compiler/src/symboltable.rs
Lines 106 to 116 in 6dccc98
| fn new(name: &str) -> Self { | |
| Symbol { | |
| name: name.to_owned(), | |
| // table, | |
| scope: SymbolScope::Unknown, | |
| is_param: false, | |
| is_referenced: false, | |
| is_assigned: false, | |
| is_parameter: false, | |
| is_free: false, | |
| } |
The is_param variable is only used in declarations and new functions.
Metadata
Metadata
Assignees
Labels
C-compatA discrepancy between RustPython and CPythonA discrepancy between RustPython and CPython