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

Rename util/{bytes,bytes_} #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion aurochs/compiler.ml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ let compile ?(start="start") ?(base="") ?(root="root") ?(check=true) u =
end;
let peg_canonified = Canonify.canonify_grammar ~start peg in
let pg = Noggie.generate_code ~start ~root peg_canonified in
Bytes.with_buffer_sink (Noggie.put_program pg peg)
Bytes_.with_buffer_sink (Noggie.put_program pg peg)

let _ = compiler := compile
2 changes: 1 addition & 1 deletion aurochs/process.ml
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ let process fno =
info `Normal "Loading NOG bytecode from file %s" fn;
Aurochs.load (`File fn)
| None ->
Bytes.with_buffer_sink (Noggie.put_program (!< pg) (!< peg))
Bytes_.with_buffer_sink (Noggie.put_program (!< pg) (!< peg))
)
in

Expand Down
2 changes: 1 addition & 1 deletion backends/camelus.ml
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ let generate_implementation ?(pack=true) fn start peg (pg : (string, string) pro
build_printer "node_name" !Opt.node_prefix node_numbers;
build_printer "attribute_name" !Opt.attribute_prefix attribute_numbers;

let u = Bytes.with_buffer_sink (Noggie.put_program pg peg) in
let u = Bytes_.with_buffer_sink (Noggie.put_program pg peg) in
fp oc "\n";
fp oc "let binary =\n";
Stringifier.print_ocaml_string ~indent:4 () oc u;
Expand Down
6 changes: 3 additions & 3 deletions backends/noggie.ml
Original file line number Diff line number Diff line change
Expand Up @@ -489,14 +489,14 @@ let put_program pg peg sk =

let put_program pg peg sk =
let sum64 = ref 0L in
let sk_sum64 = Bytes.checksum64 sum64 sk in
let sk_sum64 = Bytes_.checksum64 sum64 sk in
put_program pg peg sk_sum64;
Pack.write_uint64 sk !sum64
(* ***)
(*** save_program *)
let save_program_ascii ~prologue ~epilogue fn pg peg =
Util.with_file_output fn (fun oc ->
let u = Bytes.with_buffer_sink (put_program pg peg) in
let u = Bytes_.with_buffer_sink (put_program pg peg) in
let m = String.length u in
output_string oc prologue;
for i = 0 to m - 1 do
Expand All @@ -508,7 +508,7 @@ let save_program_ascii ~prologue ~epilogue fn pg peg =
output_string oc epilogue)
(* ***)
(*** save_program *)
let save_program fn pg peg = Util.with_binary_file_output fn (fun oc -> put_program pg peg (Bytes.sink_of_out_channel oc))
let save_program fn pg peg = Util.with_binary_file_output fn (fun oc -> put_program pg peg (Bytes_.sink_of_out_channel oc))
(* ***)
(*** generate *)
let generate fn ?(start="start") peg =
Expand Down
8 changes: 4 additions & 4 deletions pack/pack.ml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
(* Pack *)

open Bytes;;
open Bytes_;;
open Int_operators;;

type packer = Bytes.sink;;
type packer = Bytes_.sink;;
(*** write_byte *)
let write_byte sk x = Bytes.put_byte sk x;;
let write_byte sk x = Bytes_.put_byte sk x;;
(* ***)
(*** write_int64 *)
let write_int64 sk x =
Expand Down Expand Up @@ -77,7 +77,7 @@ let write_int sk x = write_int64 sk (!!!! x);;
(*** test *)
let test fn =
let oc = open_out_bin fn in
let sk = Bytes.sink_of_out_channel oc in
let sk = Bytes_.sink_of_out_channel oc in
let rec loop i x =
let y = x in
Printf.printf ">>> 0x%08Lx %Ld\n%!" y y;
Expand Down
2 changes: 1 addition & 1 deletion pack/pack.mli
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(* Pack *)

type packer = Bytes.sink;;
type packer = Bytes_.sink;;

val write_byte : packer -> int -> unit
val write_int64 : packer -> int64 -> unit
Expand Down
2 changes: 1 addition & 1 deletion util/bytes.ml → util/bytes_.ml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(* Bytes *)
(* Bytes_ *)

open Int_operators;;

Expand Down
2 changes: 1 addition & 1 deletion util/bytes.mli → util/bytes_.mli
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(* Bytes *)
(* Bytes_ *)

(** Module for byte sinks and sources. *)

Expand Down