Skip to content

Commit bda6683

Browse files
bobzhangalainfrisch
authored andcommitted
fix ocamllex -ml, works with -safe-string option (ocaml#750)
1 parent 722e6e9 commit bda6683

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Changes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,9 @@ OCaml 4.04.0:
166166

167167
### Tools:
168168

169+
- MPR#7323: ocamllex -ml work with (-safe-string)
170+
(Hongbo Zhang)
171+
169172
- MPR#7189: toplevel #show, follow chains of module aliases
170173
(Gabriel Scherer, report by Daniel Bünzli, review by Thomas Refis)
171174

lex/outputbis.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ let output_auto_defs oc has_refill =
4444
\n end\
4545
\n end else begin\
4646
\n let i = lexbuf.Lexing.lex_curr_pos in\
47-
\n let c = lexbuf.Lexing.lex_buffer.[i] in\
47+
\n let c = Bytes.get lexbuf.Lexing.lex_buffer i in\
4848
\n lexbuf.Lexing.lex_curr_pos <- i+1 ;\
4949
\n state lexbuf k (Char.code c)\
5050
\n end\
@@ -61,7 +61,7 @@ let output_auto_defs oc has_refill =
6161
\n end\
6262
\n end else begin\
6363
\n let i = lexbuf.Lexing.lex_curr_pos in\
64-
\n let c = lexbuf.Lexing.lex_buffer.[i] in\
64+
\n let c = Bytes.get lexbuf.Lexing.lex_buffer i in\
6565
\n lexbuf.Lexing.lex_curr_pos <- i+1 ;\
6666
\n Char.code c\
6767
\n end\

0 commit comments

Comments
 (0)