mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-04 02:39:20 +00:00
fix(els): eliminate unwrap
s
This commit is contained in:
parent
078f80e949
commit
2fce9bda3b
10 changed files with 98 additions and 39 deletions
|
@ -8,6 +8,7 @@ use erg_common::traits::{Locational, Runnable, Stream};
|
|||
use erg_common::Str;
|
||||
use erg_parser::ast::AST;
|
||||
use erg_parser::build_ast::ASTBuilder;
|
||||
use erg_parser::lex::Lexer;
|
||||
|
||||
use crate::context::ContextKind;
|
||||
use crate::link_ast::ASTLinker;
|
||||
|
@ -171,7 +172,8 @@ impl ASTLowerer {
|
|||
for (referee, value) in self.module.context.index().iter() {
|
||||
let code = referee.code();
|
||||
let name = code.as_ref().map(|s| &s[..]).unwrap_or("");
|
||||
let name_is_auto = name == "_"; // || name.starts_with(['%']);
|
||||
let name_is_auto =
|
||||
name == "_" || !Lexer::is_valid_start_symbol_ch(name.chars().next().unwrap_or(' '));
|
||||
if value.referrers.is_empty() && value.vi.vis.is_private() && !name_is_auto {
|
||||
let input = referee
|
||||
.module
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue