mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-04 02:39:20 +00:00
fix: Python 3.7~3.8 bugs
This commit is contained in:
parent
75c1ac733c
commit
aacdca31b8
6 changed files with 35 additions and 4 deletions
|
@ -385,6 +385,13 @@ impl Args {
|
|||
pub fn insert_pos(&mut self, idx: usize, pos: PosArg) {
|
||||
self.pos_args.insert(idx, pos);
|
||||
}
|
||||
|
||||
pub fn get_kw(&self, keyword: &str) -> Option<&Expr> {
|
||||
self.kw_args
|
||||
.iter()
|
||||
.find(|kw| kw.keyword.inspect() == keyword)
|
||||
.map(|kw| &kw.expr)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue