Skip to content

Unused variable of symbol in symbol table #1879

Closed
@HyeockJinKim

Description

@HyeockJinKim

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.

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,
}

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

No one assigned

    Labels

    C-compatA discrepancy between RustPython and CPython

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions