Commit | Line | Data |
---|---|---|
ec9d9325 JL |
1 | From aeca7656f499d7f4595319858f242276920e31bb Mon Sep 17 00:00:00 2001 |
2 | From: Louis Gesbert <louis.gesbert@ocamlpro.com> | |
3 | Date: Sat, 2 Dec 2017 12:51:01 +0100 | |
4 | Subject: [PATCH] Fix for ocaml 4.06 | |
5 | ||
6 | --- | |
7 | common/criteria_lexer.mll | 8 ++++---- | |
8 | common/util.ml | 2 +- | |
9 | 2 files changed, 5 insertions(+), 5 deletions(-) | |
10 | ||
11 | diff --git a/common/criteria_lexer.mll b/common/criteria_lexer.mll | |
12 | index 71f9178..fc4eae3 100644 | |
13 | --- a/common/criteria_lexer.mll | |
14 | +++ b/common/criteria_lexer.mll | |
15 | @@ -18,7 +18,7 @@ | |
16 | let c = Lexing.lexeme_char lexbuf 2 in (* the delimiter can be any character *) | |
17 | (* find the terminating delimiter *) | |
18 | let endpos = | |
19 | - try String.index_from lexbuf.lex_buffer (lexbuf.lex_start_pos + 3) c with | |
20 | + try Bytes.index_from lexbuf.lex_buffer (lexbuf.lex_start_pos + 3) c with | |
21 | |Invalid_argument _ -> | |
22 | raise (Format822.Syntax_error ( | |
23 | Format822.error lexbuf "String too short")) | |
24 | @@ -27,9 +27,9 @@ | |
25 | Format822.error lexbuf (Printf.sprintf "cannot find: %c" c))) | |
26 | in | |
27 | let len = endpos - (lexbuf.lex_start_pos + 3) in | |
28 | - let s = String.sub lexbuf.lex_buffer (lexbuf.lex_start_pos + 3) len in | |
29 | - lexbuf.Lexing.lex_curr_pos <- lexbuf.Lexing.lex_start_pos + ((String.length s)+4); | |
30 | - s | |
31 | + let s = Bytes.sub lexbuf.lex_buffer (lexbuf.lex_start_pos + 3) len in | |
32 | + lexbuf.Lexing.lex_curr_pos <- lexbuf.Lexing.lex_start_pos + ((Bytes.length s)+4); | |
33 | + Bytes.to_string s | |
34 | ||
35 | } | |
36 | ||
37 | diff --git a/common/util.ml b/common/util.ml | |
38 | index 598f266..36ca3d1 100644 | |
39 | --- a/common/util.ml | |
40 | +++ b/common/util.ml | |
41 | @@ -87,7 +87,7 @@ module MakeMessages(X : sig val label : string end) = struct | |
42 | let clean label = | |
43 | try | |
44 | let s = Filename.chop_extension (Filename.basename label) in | |
45 | - String.capitalize s | |
46 | + String.capitalize_ascii s | |
47 | with Invalid_argument _ -> label | |
48 | ||
49 | let create ?(enabled=false) label = | |
50 | -- | |
51 | 2.11.0 | |
52 |