Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formatting fixes, ocamlformat and makefile #926

Merged
merged 4 commits into from
Mar 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
670beb4cfad7e191c6f414fbfecfe183349567d9
8a85a1a8611a2fbc3fdd336ab25a867f22e0d01c
a347d30c5f4b0c76e6a517debb3890f411dba3ab

# Running ocamlformat
ffaf97e175955b7dc7589b8308bb7d712d9af71a
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ uninstall-boot:

.PHONY: lint
lint:
misc/scripts/with-tmp-dir dune fmt --root=src/boot/ --build-dir="{}"
misc/scripts/with-tmp-dir dune build @fmt --root=src/boot/ --build-dir="{}"

.PHONY: fix
fix:
misc/scripts/with-tmp-dir dune fmt --root=src/boot/ --build-dir="{}" --auto-promote
misc/scripts/with-tmp-dir dune fmt --root=src/boot/ --build-dir="{}"


# Bootstrapping the `mi` executable
Expand Down Expand Up @@ -96,7 +96,7 @@ uninstall:
# or `misc/watch` to autorun tests when files change)

.PHONY: test test-all test-quick
test test-all test-quick:
test test-all test-quick: lint
test:
+ exec misc/test --bootstrapped smart

Expand Down
9 changes: 4 additions & 5 deletions src/boot/lib/mlang.ml
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ type alias_data =

type ty_in_lang = (alias_data, syn_data) Either.t

type lang_data = {values: sem_data Record.t; types: ty_in_lang Record.t; fi: info}
type lang_data =
{values: sem_data Record.t; types: ty_in_lang Record.t; fi: info}

(* let spprint_inter_data {info; cases; _} : ustring = *)
(* List.map *)
Expand Down Expand Up @@ -342,9 +343,7 @@ let merge_langs : info -> lang_data -> lang_data -> lang_data =
Record.union
(fun name a b -> Some (merge_types_in_lang fi name a b))
a.types b.types
; fi=
a.fi
}
; fi= a.fi }

(* === Functions that facilitate renaming types and values, and thus merging them after the fact === *)

Expand Down Expand Up @@ -1099,7 +1098,7 @@ let translate_lang (env : mlang_env) (Lang (fi, name, includes, renames, decls))
List.to_seq includes |> Seq.map fetch_include |> Record.of_seq
in
let includes = List.fold_left apply_rename includes renames in
let lang = {values= Record.empty; types= Record.empty; fi= fi} in
let lang = {values= Record.empty; types= Record.empty; fi} in
let lang =
Record.to_seq includes |> Seq.map snd
|> Seq.fold_left (merge_langs fi) lang
Expand Down
3 changes: 2 additions & 1 deletion src/boot/lib/symbutils.ml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ let symbmap t =

let pprint_symb s = us (Printf.sprintf "%d" (Symb.hash s))

let pprint_named_symb symbmap s = Option.value (SymbMap.find_opt s symbmap) ~default:(us "<Missing>")
let pprint_named_symb symbmap s =
Option.value (SymbMap.find_opt s symbmap) ~default:(us "<Missing>")

let pprint_symbset ss =
us "{"
Expand Down
Loading