Skip to content

Commit 5d5dc43

Browse files
authored
Merge pull request ocaml-community#71 from smolkaj/master
upgrade to dune, opam >= 2.0
2 parents 739b047 + 0478f07 commit 5d5dc43

File tree

10 files changed

+88
-95
lines changed

10 files changed

+88
-95
lines changed

Makefile

+7-7
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,21 @@ INSTALL_ARGS := $(if $(PREFIX),--prefix $(PREFIX),)
77
.PHONY: build install uninstall clean doc test all
88

99
build:
10-
jbuilder build @install
10+
dune build @install
1111

1212
install:
13-
jbuilder install $(INSTALL_ARGS)
13+
dune install $(INSTALL_ARGS)
1414

1515
uninstall:
16-
jbuilder uninstall $(INSTALL_ARGS)
16+
dune uninstall $(INSTALL_ARGS)
1717

1818
clean:
19-
jbuilder clean
19+
dune clean
2020

2121
doc:
22-
jbuilder build @doc
22+
dune build @doc
2323

2424
test:
25-
jbuilder build @runtest
25+
dune build @runtest
2626

27-
all: build doc
27+
all: build test doc

dune-project

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
(lang dune 1.0)
2+
(name sedlex)

examples/dune

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
(executables
2+
(names tokenizer complement subtraction repeat performance)
3+
(libraries sedlex)
4+
(preprocess
5+
(pps sedlex.ppx))
6+
(flags :standard -w -39))
7+
8+
(alias
9+
(name runtest)
10+
(deps
11+
(:< tokenizer.exe))
12+
(action
13+
(run %{<})))
14+
15+
(alias
16+
(name runtest)
17+
(deps
18+
(:< complement.exe))
19+
(action
20+
(run %{<})))
21+
22+
(alias
23+
(name runtest)
24+
(deps
25+
(:< subtraction.exe))
26+
(action
27+
(run %{<})))
28+
29+
(alias
30+
(name runtest)
31+
(deps
32+
(:< repeat.exe))
33+
(action
34+
(run %{<})))
35+
36+
(alias
37+
(name runtest)
38+
(deps
39+
(:< performance.exe))
40+
(action
41+
(run %{<})))

examples/jbuild

-43
This file was deleted.

examples/performance.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ let time f x =
1515

1616
let () =
1717
let long_str = String.make 1000000 '\n' in
18-
let token_from str =
18+
let token_from _ =
1919
let lexbuf = Sedlexing.Latin1.from_string long_str in
2020
(* let () = Sedlexing.set_curr_p lexbuf Lexing.dummy_pos in *)
2121
token lexbuf

sedlex.opam

+22-18
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,27 @@
1-
opam-version: "1.2"
1+
opam-version: "2.0"
22
name: "sedlex"
3-
version: "1.99.4"
3+
synopsis: "An OCaml lexer generator for Unicode"
4+
version: "1.99.5"
5+
license: "MIT"
46
maintainer: "Alain Frisch <[email protected]>"
57
authors: [
68
"Alain Frisch <[email protected]>"
9+
"https://github.com/ocaml-community/sedlex/graphs/contributors"
10+
]
11+
homepage: "https://github.com/ocaml-community/sedlex"
12+
dev-repo: "git+https://github.com/ocaml-community/sedlex.git"
13+
bug-reports: "https://github.com/ocaml-community/sedlex/issues"
14+
build: [
15+
["dune" "subst"] {pinned}
16+
["dune" "build" "-p" name "-j" jobs]
17+
["dune" "runtest" "-p" name "-j" jobs] {with-test}
18+
["dune" "build" "@doc" "-p" name "-j" jobs] {with-doc}
19+
]
20+
depends: [
21+
"ocaml" {build & >= "4.02.3"}
22+
"dune" {build & >= "1.0"}
23+
"ppx_tools_versioned"
24+
"ocaml-migrate-parsetree"
25+
"gen"
26+
"uchar"
727
]
8-
9-
build: ["jbuilder" "build" "-p" name "-j" jobs]
10-
build-doc: ["jbuilder" "build" "@doc" "-p" name "-j" jobs]
11-
build-test: ["jbuilder" "runtest" "-p" name "-j" jobs]
12-
13-
depends: ["jbuilder" {build}
14-
"ppx_tools_versioned"
15-
"ocaml-migrate-parsetree"
16-
"gen"
17-
"uchar"
18-
]
19-
available: [ ocaml-version >= "4.02.3" ]
20-
homepage: "https://github.com/alainfrisch/sedlex"
21-
bug-reports: "https://github.com/alainfrisch/sedlex/issues"
22-
license: "MIT"
23-
dev-repo: "https://github.com/alainfrisch/sedlex.git"

src/lib/dune

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
(library
2+
(name sedlex)
3+
(public_name sedlex)
4+
(wrapped false)
5+
(libraries gen uchar)
6+
(flags :standard -w +A-4-9 -safe-string))

src/lib/jbuild

-10
This file was deleted.

src/syntax/dune

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
(library
2+
(name sedlex_ppx)
3+
(public_name sedlex.ppx)
4+
(kind ppx_rewriter)
5+
(libraries ppx_tools_versioned.metaquot_405 ocaml-migrate-parsetree sedlex)
6+
(ppx_runtime_libraries sedlex)
7+
(preprocess
8+
(pps ppx_tools_versioned.metaquot_405))
9+
(flags (:standard -w -9)))

src/syntax/jbuild

-16
This file was deleted.

0 commit comments

Comments
 (0)