Skip to content

Commit

Permalink
match raw pretty printing of optional_else and indented_block (#51)
Browse files Browse the repository at this point in the history
* pp-raw for optional_else uses same format as indented_block

* call pp_raw_indented_block from optional_else
  • Loading branch information
mmcloughlin authored and katrinafyi committed Mar 12, 2024
1 parent cd41839 commit 94f73a2
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions libASL/asl.ott
Original file line number Diff line number Diff line change
Expand Up @@ -630,8 +630,7 @@ s_elsif :: 'S_Elsif_' ::=

optional_else :: 'S_Else' ::=
{{ phantom }} {{ ocaml stmt list }}
{{ pp-raw x = match x with [] -> string ""
| ys -> string "(else " ^^ separate (string "\n") (List.map pp_raw_stmt ys) ^^ string ")" }}
{{ pp-raw x = pp_raw_indented_block x }}
{{ pp x = match x with [] -> string ""
| ys -> string "else {" ^^ hardline
^^ (nest 4 (separate (string "\n") (List.map pp_stmt ys @ [string "}"])))
Expand Down

0 comments on commit 94f73a2

Please sign in to comment.