MCPcopy Create free account
hub / github.com/argumentcomputer/ix / serialize_syntax_inner

Function serialize_syntax_inner

crates/compile/src/compile.rs:1492–1524  ·  view source on GitHub ↗
(
  syn: &LeanSyntax,
  stt: &CompileState,
  bytes: &mut Vec<u8>,
)

Source from the content-addressed store, hash-verified

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, _) => {

Callers 1

serialize_syntaxFunction · 0.85

Calls 9

serialize_source_infoFunction · 0.85
compile_nameFunction · 0.85
store_stringFunction · 0.85
serialize_substringFunction · 0.85
serialize_preresolvedFunction · 0.85
pushMethod · 0.80
as_bytesMethod · 0.80
putMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected