( syn: &LeanSyntax, stt: &CompileState, bytes: &mut Vec<u8>, )
| 1490 | stack.push(Frame::Compile(arg.clone())); |
| 1491 | } |
| 1492 | for arg in sorted_canon.iter().rev() { |
| 1493 | stack.push(Frame::Compile(arg.clone())); |
| 1494 | } |
| 1495 | stack.push(Frame::Compile(head_expr.clone())); |
| 1496 | continue; |
| 1497 | } |
| 1498 | } |
| 1499 | } |
| 1500 | } |
| 1501 | |
| 1502 | // Normal telescope path: interleave BuildApp + Compile(arg) for |
| 1503 | // each arg (right to left), then Compile(head). |
| 1504 | // This compiles the same result as the recursive one-App-at-a-time |
| 1505 | // approach, but avoids re-entering the App branch for inner nodes. |
| 1506 | for &arg in args.iter().rev() { |
| 1507 | stack.push(Frame::BuildApp); |
| 1508 | stack.push(Frame::Compile(arg.clone())); |
| 1509 | } |
| 1510 | stack.push(Frame::Compile(head_expr.clone())); |
| 1511 | }, |
| 1512 | |
| 1513 | ExprData::Lam(name, ty, body, info, _) => { |
| 1514 | let name_addr = compile_name(name, stt); |
| 1515 | stack.push(Frame::BuildLam(name_addr, info.clone())); |
| 1516 | stack.push(Frame::Compile(body.clone())); |
| 1517 | stack.push(Frame::Compile(ty.clone())); |
| 1518 | }, |
| 1519 | |
| 1520 | ExprData::ForallE(name, ty, body, info, _) => { |
| 1521 | let name_addr = compile_name(name, stt); |
| 1522 | stack.push(Frame::BuildAll(name_addr, info.clone())); |
| 1523 | stack.push(Frame::Compile(body.clone())); |
| 1524 | stack.push(Frame::Compile(ty.clone())); |
| 1525 | }, |
| 1526 | |
| 1527 | ExprData::LetE(name, ty, val, body, non_dep, _) => { |
no test coverage detected