The unpac monorepo manager self-hosting as a monorepo using unpac

Make the hash-consing domain-safe

Kate b38fa968 fca394f3

+21 -6
+1 -1
vendor/opam/opam-file-format/README.md
··· 1 # opam-file-format - Parser and printer for the opam file syntax 2 3 This library provides the parser and printer for the opam file syntax as a 4 - library with no dependencies but [Dune](https://dune.build) >= 2.0. 5 6 Opam was created and is maintained by [OCamlPro](http://www.ocamlpro.com). 7
··· 1 # opam-file-format - Parser and printer for the opam file syntax 2 3 This library provides the parser and printer for the opam file syntax as a 4 + library with no dependencies but [Dune](https://dune.build) >= 3.13. 5 6 Opam was created and is maintained by [OCamlPro](http://www.ocamlpro.com). 7
+1 -1
vendor/opam/opam-file-format/dune-project
··· 1 - (lang dune 2.0) 2 (using menhir 2.0)
··· 1 + (lang dune 3.13) 2 (using menhir 2.0)
+1 -1
vendor/opam/opam-file-format/opam-file-format.opam
··· 11 run-test: ["dune" "runtest" "-p" name "-j" jobs] 12 depends: [ 13 "ocaml" {>= "4.02"} 14 - "dune" {>= "2.0"} 15 "menhir" {>= "20211230"} 16 "alcotest" {with-test & >= "0.4.8"} 17 "fmt" {with-test}
··· 11 run-test: ["dune" "runtest" "-p" name "-j" jobs] 12 depends: [ 13 "ocaml" {>= "4.02"} 14 + "dune" {>= "3.13"} 15 "menhir" {>= "20211230"} 16 "alcotest" {with-test & >= "0.4.8"} 17 "fmt" {with-test}
+4
vendor/opam/opam-file-format/src/compat/domain.ml
···
··· 1 + module DLS = struct 2 + let new_key f = f () 3 + let get x = x 4 + end
+6
vendor/opam/opam-file-format/src/compat/dune
···
··· 1 + (rule 2 + (enabled_if (< %{ocaml_version} "5.0")) 3 + (action (with-stdout-to compat.sexp (echo "(\"domain\")")))) 4 + (rule 5 + (enabled_if (>= %{ocaml_version} "5.0")) 6 + (action (with-stdout-to compat.sexp (echo "()"))))
+5
vendor/opam/opam-file-format/src/dune
··· 3 (public_name opam-file-format) 4 (synopsis "Parser and printer for the opam file syntax") 5 (wrapped false) 6 (flags :standard (:include flags.sexp))) 7 8 (rule 9 (enabled_if (< %{ocaml_version} "4.03"))
··· 3 (public_name opam-file-format) 4 (synopsis "Parser and printer for the opam file syntax") 5 (wrapped false) 6 + (private_modules (:include compat/compat.sexp)) 7 (flags :standard (:include flags.sexp))) 8 + 9 + (rule 10 + (enabled_if (< %{ocaml_version} "5.0")) 11 + (action (copy compat/domain.ml domain.ml))) 12 13 (rule 14 (enabled_if (< %{ocaml_version} "4.03"))
+3 -3
vendor/opam/opam-file-format/src/opamLexer.mll
··· 84 (* Some hash-consing for strings *) 85 module HS = 86 Weak.Make(struct include String let hash = Hashtbl.hash let equal = (=) end) 87 - let hm = HS.create 317 88 89 90 let buffer_rule r lb = ··· 93 r b lb ; 94 (* buffer start position, instead of last lexem position *) 95 lb.Lexing.lex_start_p <- pos; 96 - HS.merge hm (Buffer.contents b) 97 } 98 99 let eol = '\r'? '\n' ··· 131 | "true" { BOOL true } 132 | "false"{ BOOL false } 133 | int { INT (int_of_string (Lexing.lexeme lexbuf)) } 134 - | ident { IDENT (HS.merge hm (Lexing.lexeme lexbuf)) } 135 | relop { RELOP (FullPos.relop (Lexing.lexeme lexbuf)) } 136 | '&' { AND } 137 | '|' { OR }
··· 84 (* Some hash-consing for strings *) 85 module HS = 86 Weak.Make(struct include String let hash = Hashtbl.hash let equal = (=) end) 87 + let hm = Domain.DLS.new_key (fun () -> HS.create 317) 88 89 90 let buffer_rule r lb = ··· 93 r b lb ; 94 (* buffer start position, instead of last lexem position *) 95 lb.Lexing.lex_start_p <- pos; 96 + HS.merge (Domain.DLS.get hm) (Buffer.contents b) 97 } 98 99 let eol = '\r'? '\n' ··· 131 | "true" { BOOL true } 132 | "false"{ BOOL false } 133 | int { INT (int_of_string (Lexing.lexeme lexbuf)) } 134 + | ident { IDENT (HS.merge (Domain.DLS.get hm) (Lexing.lexeme lexbuf)) } 135 | relop { RELOP (FullPos.relop (Lexing.lexeme lexbuf)) } 136 | '&' { AND } 137 | '|' { OR }