Skip to content

Commit

Permalink
use external appendable-list package
Browse files Browse the repository at this point in the history
  • Loading branch information
mbarbin committed Oct 28, 2023
1 parent 0b5937d commit 9a82cdc
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 83 deletions.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,17 @@ a [7-segment display](project/digital-watch/).

# ![ladybug ico](../assets/image/ladybug_32.ico?raw=true) Install

The repo depends on unreleased packages that are found in an external
opam-repository, which must be added to the current switch:

```sh
opam repo add mbarbin https://github.com/mbarbin/opam-repository.git
```

Please note that only installation from sources is currently supported. Clone
the repository, then build and install the code with dune:

```
```sh
dune build
dune install
```
Expand Down
1 change: 1 addition & 0 deletions bopkit.opam
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ depends: [
"ocaml" {>= "5.0"}
"dune" {>= "3.11"}
"dune-site" {>= "3.11"}
"appendable-list" {>= "v0.16" & < "v0.17"}
"ANSITerminal" {>= "0.8.3"}
"bogue" {>= "20221112"}
"core" {>= "v0.16" & < "v0.17"}
Expand Down
41 changes: 0 additions & 41 deletions lib/appendable_list/src/appendable_list.ml

This file was deleted.

16 changes: 0 additions & 16 deletions lib/appendable_list/src/appendable_list.mli

This file was deleted.

7 changes: 0 additions & 7 deletions lib/appendable_list/src/dune

This file was deleted.

2 changes: 1 addition & 1 deletion lib/bopkit/src/dune
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
(name bopkit)
(public_name bopkit.bopkit)
(flags -w +a-4-40-42-44-66 -warn-error +a)
(libraries appendable_list bit_utils core error_log parsing_utils pp)
(libraries appendable-list bit_utils core error_log parsing_utils pp)
(preprocess
(pps ppx_jane ppx_js_style -check-doc-comments)))
22 changes: 9 additions & 13 deletions lib/bopkit_compiler/src/block_sort.ml
Original file line number Diff line number Diff line change
Expand Up @@ -26,29 +26,25 @@ struct
if List.mem functional_args name ~equal:String.equal
then Appendable_list.empty
else
Appendable_list.of_list
Appendable_list.singleton
(match arguments, functional_arguments with
| [], [] -> [ name ]
| _ -> [ Printf.sprintf "%s[]" name ])
| [], [] -> name
| _ -> Printf.sprintf "%s[]" name)
and aux_imbrication : Bopkit.Netlist.nested_inputs -> _ = function
| Nested_node { loc = _; comments = _; call; inputs } ->
Appendable_list.append
(aux_call call)
(Appendable_list.concat_map inputs ~f:aux_imbrication)
Appendable_list.concat (aux_call call :: List.map inputs ~f:aux_imbrication)
| Variables _ -> Appendable_list.empty
and aux_node : Bopkit.Netlist.node Bopkit.Control_structure.t -> _ = function
| Node { loc = _; comments = _; call; inputs; outputs = _ } ->
Appendable_list.append
(aux_call call)
(Appendable_list.concat_map inputs ~f:aux_imbrication)
Appendable_list.concat (aux_call call :: List.map inputs ~f:aux_imbrication)
| For_loop { nodes = node_list; _ } ->
Appendable_list.concat_map node_list ~f:aux_node
List.map node_list ~f:aux_node |> Appendable_list.concat
| If_then_else { then_nodes = node_then; else_nodes = node_else; _ } ->
Appendable_list.append
(Appendable_list.concat_map node_then ~f:aux_node)
(Appendable_list.concat_map node_else ~f:aux_node)
(List.map node_then ~f:aux_node |> Appendable_list.concat)
(List.map node_else ~f:aux_node |> Appendable_list.concat)
in
Appendable_list.concat_map nodes ~f:aux_node
List.map nodes ~f:aux_node |> Appendable_list.concat
;;
end

Expand Down
2 changes: 1 addition & 1 deletion lib/bopkit_compiler/src/dune
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
(public_name bopkit.compiler)
(flags -w +a-4-40-41-42-44-45-66 -warn-error +a)
(libraries
appendable_list
appendable-list
bopkit
core
core_unix.command_unix
Expand Down
4 changes: 2 additions & 2 deletions lib/bopkit_compiler/src/expanded_block_sort.ml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ module Expanded_block_node :
let nodes = fct.nodes in
let rec aux_call : Bopkit.Expanded_netlist.call -> _ = function
| External_block _ -> Appendable_list.empty
| Block { name } -> Appendable_list.of_list [ name ]
| Block { name } -> Appendable_list.singleton name
and aux_node : Bopkit.Expanded_netlist.node -> _ = function
| { loc = _; call; inputs = _; outputs = _ } -> aux_call call
in
Appendable_list.concat_map nodes ~f:aux_node
List.map nodes ~f:aux_node |> Appendable_list.concat
;;
end

Expand Down
2 changes: 1 addition & 1 deletion lib/bopkit_topological_sort/src/dune
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
(name bopkit_topological_sort)
(public_name bopkit.topological-sort)
(flags -w +a-4-40-42-44-66 -warn-error +a)
(libraries core appendable_list error_log)
(libraries core appendable-list error_log)
(preprocess
(pps ppx_jane ppx_js_style -check-doc-comments)))

0 comments on commit 9a82cdc

Please sign in to comment.