Skip to content

Commit

Permalink
ToDocument: preserve state of unfold_tuples
Browse files Browse the repository at this point in the history
  • Loading branch information
tahina-pro committed Jan 28, 2023
1 parent 7b4a0c9 commit 0b02e48
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/parser/FStar.Parser.ToDocument.fst
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ module BU = FStar.Compiler.Util


(* !!! SIDE EFFECT WARNING !!! *)
(* There is 1 uses of global side-effect in the printer for : *)
(* There are 2 uses of global side-effect in the printer for : *)
(* - Printing the comments [comment_stack] *)
(* - Printing tuples [unfold_tuples] *)

let maybe_unthunk t =
match t.tm with
Expand Down Expand Up @@ -2121,8 +2122,11 @@ and p_atomicUniverse u = match u.tm with
| _ -> failwith (Util.format1 "Invalid term in universe context %s" (term_to_string u))
let term_to_document e =
let old_unfold_tuples = !unfold_tuples in
unfold_tuples := false;
p_term false false e
let res = p_term false false e in
unfold_tuples := old_unfold_tuples;
res
let signature_to_document e = p_justSig e
Expand Down

0 comments on commit 0b02e48

Please sign in to comment.