Permalink
Browse files

[build] fix build to use the latest version of ocaml-re

  • Loading branch information...
1 parent 7a9384e commit 061a37604fd0f6a8131cc4e13fe4a0e0c89a1372 @samoht samoht committed May 21, 2012
Showing with 7 additions and 90 deletions.
  1. +3 −2 Makefile
  2. +2 −2 src_ext/Makefile
  3. +2 −7 src_ext/depends.ocp.boot
  4. +0 −77 src_ext/pcre/pcre.ml
  5. +0 −2 tests/Makefile
View
@@ -10,8 +10,9 @@ TARGETS = opam opam-server \
.PHONY: all
-all: ./_obuild/unixrun compile clone
- @
+all: ./_obuild/unixrun
+ $(MAKE) clone
+ $(MAKE) compile
scan: ./_obuild/unixrun
$(OCPBUILD) -scan
View
@@ -35,8 +35,8 @@ ocamlgraph:
mv ocamlgraph-1.8.1 ocamlgraph
ocaml-re:
- $(WGET) http://www.ocamlpro.com/pub/ocaml-re.tar.bz2
- tar xfj ocaml-re.tar.bz2
+ $(WGET) http://www.ocamlpro.com/pub/ocaml-re.tar.gz
+ tar xfz ocaml-re.tar.gz
clean:
rm -rf *~
View
@@ -29,22 +29,17 @@ end
begin library "re"
sort = true
files = [
- "ocaml-re/lib/re_str.ml"
"ocaml-re/lib/re_posix.ml"
"ocaml-re/lib/re_perl.ml"
"ocaml-re/lib/re_glob.ml"
"ocaml-re/lib/re_emacs.ml"
"ocaml-re/lib/re.ml"
+ "ocaml-re/lib/pcre.ml"
"ocaml-re/lib/cset.ml"
"ocaml-re/lib/automata.ml"
]
end
-begin library "pcre"
- files = [ "pcre/pcre.ml" ]
- requires = [ "re" ]
-end
-
begin library "arg"
files = [
"ocaml-arg/src/subCommand.ml"
@@ -169,7 +164,7 @@ begin library "dose"
]]
requires = [
- "pcre"
+ "re"
"extlib"
"cudf"
"graph"
View
@@ -1,77 +0,0 @@
-type regexp = Re.re
-
-let regexp ?(flags = []) pat =
- let opts = List.map (function
- | `CASELESS -> `Caseless
- ) flags in
- Re_perl.compile_pat ~opts pat
-
-let extract ~rex s =
- Re.get_all (Re.exec rex s)
-
-let exec ~rex ?pos s =
- Re.exec rex ?pos s
-
-let get_substring s i =
- Re.get s i
-
-let get_substring_ofs s i =
- Re.get_ofs s i
-
-let pmatch ~rex s =
- Re.execp rex s
-
-let substitute ~rex ~subst str =
- let b = Buffer.create 1024 in
- let rec loop pos =
- if pos >= String.length str then
- Buffer.contents b
- else if Re.execp ~pos rex str then (
- let ss = Re.exec ~pos rex str in
- let start, fin = Re.get_ofs ss 0 in
- let pat = Re.get ss 0 in
- Buffer.add_substring b str pos (start - pos);
- Buffer.add_string b (subst pat);
- loop fin
- ) else (
- Buffer.add_substring b str pos (String.length str - pos);
- loop (String.length str)
- )
- in
- loop 0
-
-let split ~rex str =
- let rec loop accu pos =
- if pos >= String.length str then
- List.rev accu
- else if Re.execp ~pos rex str then (
- let ss = Re.exec ~pos rex str in
- let start, fin = Re.get_ofs ss 0 in
- let s = String.sub str pos (start - pos) in
- loop (s :: accu) fin
- ) else (
- let s = String.sub str pos (String.length str - pos) in
- loop (s :: accu) (String.length str)
- ) in
- loop [] 0
-
-(* From PCRE *)
-let string_unsafe_sub s ofs len =
- let r = String.create len in
- String.unsafe_blit s ofs r 0 len;
- r
-
-let quote s =
- let len = String.length s in
- let buf = String.create (len lsl 1) in
- let pos = ref 0 in
- for i = 0 to len - 1 do
- match String.unsafe_get s i with
- | '\\' | '^' | '$' | '.' | '[' | '|'
- | '(' | ')' | '?' | '*' | '+' | '{' as c ->
- String.unsafe_set buf !pos '\\';
- incr pos;
- String.unsafe_set buf !pos c; incr pos
- | c -> String.unsafe_set buf !pos c; incr pos
- done;
- string_unsafe_sub buf 0 !pos
View
@@ -45,8 +45,6 @@ all:
$(MAKE) upgrade && \
$(MAKE) list && \
$(MAKE) downgrade && \
- $(MAKE) list && \
- $(MAKE) switch && \
$(MAKE) list
server:

0 comments on commit 061a376

Please sign in to comment.