Skip to content

Commit

Permalink
fix in case of no register
Browse files Browse the repository at this point in the history
  • Loading branch information
lfrenot committed Jan 14, 2025
1 parent 5027c67 commit 70b380d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/sail_lean_backend/pretty_print_lean.ml
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,8 @@ let pp_ast_lean ({ defs; _ } as ast : Libsail.Type_check.typed_ast) o effect_inf
let defs = remove_imports defs 0 in
let global = { effect_info } in
let ctxt = { empty_context with global } in
let register_refs = State.register_refs_lean (doc_id ctxt) (doc_typ ctxt) (State.find_registers defs) in
let regs = State.find_registers defs in
let register_refs = match regs with [] -> empty | _ -> State.register_refs_lean (doc_id ctxt) (doc_typ ctxt) regs in
let output : document = separate_map empty (doc_def ctxt) defs in
print o (register_refs ^^ hardline ^^ output);
()

0 comments on commit 70b380d

Please sign in to comment.