Commit e2fc3b4a authored by Julien Lopez's avatar Julien Lopez

[MINOR] Remove dependence with Str module in parser

parent 5aabfea3
......@@ -17,7 +17,7 @@ ifeq ($(NATIVE),true)
all: cduce_lib.cmxa
endif
PACKAGES = dynlink camlp4 ulex pcre num netstring str
PACKAGES = dynlink camlp4 ulex pcre num netstring
# Call make with VERBOSE=true to get a trace of commands
......
......@@ -291,8 +291,13 @@ and token2 = lexer
| _ -> assert false) () lexbuf
| "(" [" \t"]* "'" ncname [" \t"]* ")" ->
let s = L.utf8_lexeme lexbuf in
let s = Str.global_replace (Str.regexp "[ \t]") "" s in
let s = String.sub s 2 (String.length s - 3) in
let idstart = String.index s '\'' + 1 in
let s = String.sub s idstart (String.length s - idstart) in
let len = String.length s in
let idend = min (min (try String.index s ' ' with _ -> len)
(try String.index s '\t' with _ -> len))
(try String.index s ')' with _ -> len) in
let s = String.sub s 0 idend in
return lexbuf (PTYPE s)
| "'" ncname ->
let s = L.utf8_lexeme lexbuf in
......@@ -351,8 +356,13 @@ and token2toplevel = lexer
| _ -> assert false) () lexbuf
| "(" [" \t"]* "'" ncname [" \t"]* ")" ->
let s = L.utf8_lexeme lexbuf in
let s = Str.global_replace (Str.regexp "[ \t]") "" s in
let s = String.sub s 2 (String.length s - 3) in
let idstart = String.index s '\'' + 1 in
let s = String.sub s idstart (String.length s - idstart) in
let len = String.length s in
let idend = min (min (try String.index s ' ' with _ -> len)
(try String.index s '\t' with _ -> len))
(try String.index s ')' with _ -> len) in
let s = String.sub s 0 idend in
return lexbuf (PTYPE s)
| "'" ncname ->
let s = L.utf8_lexeme lexbuf in
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment