mirror of
https://github.com/erg-lang/erg.git
synced 2025-10-02 13:41:10 +00:00
eliminate lpop
and use into_iter
This commit is contained in:
parent
c59cace06b
commit
43a3fa6e30
2 changed files with 4 additions and 4 deletions
|
@ -305,9 +305,9 @@ impl Desugarer {
|
|||
|
||||
/// `fib 0 = 0; fib 1 = 1; fib n = fib(n-1) + fib(n-2)`
|
||||
/// -> `fib n = match n, (0 -> 0), (1 -> 1), n -> fib(n-1) + fib(n-2)`
|
||||
fn desugar_multiple_pattern_def(&self, mut module: Module) -> Module {
|
||||
fn desugar_multiple_pattern_def(&self, module: Module) -> Module {
|
||||
let mut new = Module::with_capacity(module.len());
|
||||
while let Some(chunk) = module.lpop() {
|
||||
for chunk in module.into_iter() {
|
||||
match chunk {
|
||||
Expr::Def(def) if def.is_subr() => {
|
||||
if let Some(Expr::Def(previous)) = new.last() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue