Update symbol_declaration.rs

This commit is contained in:
Yanting Zhang 2022-08-31 22:04:10 +08:00
parent 62700597e0
commit aaf0ff373b
1 changed files with 2 additions and 0 deletions

View File

@ -305,6 +305,7 @@ impl<'a> SymbolDeclaration {
if json_names.len() != 0 { if json_names.len() != 0 {
for json_name in json_names { for json_name in json_names {
if json_name.len() != 0 {
let name = &json_name["text"].to_string(); let name = &json_name["text"].to_string();
let symbol = SymbolInfo::new(kind, IntValue::zero(width), json_name); let symbol = SymbolInfo::new(kind, IntValue::zero(width), json_name);
if !context.symbol.contains_key(name) { if !context.symbol.contains_key(name) {
@ -316,6 +317,7 @@ impl<'a> SymbolDeclaration {
} }
} }
} }
}
fn gen_var_width(json: &JsonValue, dim_path: Vec<&str>) -> usize { fn gen_var_width(json: &JsonValue, dim_path: Vec<&str>) -> usize {
let json_dims = Tools::match_tags(vec![json], dim_path); let json_dims = Tools::match_tags(vec![json], dim_path);