changement des locations, bug trouve par DDR

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5258 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
master
Damien Doligez 2002-11-12 17:47:54 +00:00
parent 1404188744
commit 51233b6e83
1 changed files with 10 additions and 6 deletions

View File

@ -61,18 +61,22 @@ external c_engine: lex_tables -> int -> lexbuf -> int = "lex_engine"
external c_new_engine: lex_tables -> int -> lexbuf -> int = "new_lex_engine"
let engine tbl state buf =
buf.lex_start_p <- buf.lex_curr_p;
let result = c_engine tbl state buf in
buf.lex_curr_p <- {buf.lex_curr_p
with pos_cnum = buf.lex_abs_pos + buf.lex_curr_pos};
if result >= 0 then begin
buf.lex_start_p <- buf.lex_curr_p;
buf.lex_curr_p <- {buf.lex_curr_p
with pos_cnum = buf.lex_abs_pos + buf.lex_curr_pos};
end;
result
;;
let new_engine tbl state buf =
buf.lex_start_p <- buf.lex_curr_p;
let result = c_new_engine tbl state buf in
buf.lex_curr_p <- {buf.lex_curr_p
with pos_cnum = buf.lex_abs_pos + buf.lex_curr_pos};
if result >= 0 then begin
buf.lex_start_p <- buf.lex_curr_p;
buf.lex_curr_p <- {buf.lex_curr_p
with pos_cnum = buf.lex_abs_pos + buf.lex_curr_pos};
end;
result
;;