Skip to content

Commit

Permalink
Lexing.flush_input: completely reset the current position
Browse files Browse the repository at this point in the history
  • Loading branch information
Armaël Guéneau committed Jul 23, 2018
1 parent 2e93925 commit 65c8c79
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion stdlib/lexing.ml
Original file line number Diff line number Diff line change
Expand Up @@ -232,5 +232,6 @@ let flush_input lb =
lb.lex_curr_pos <- 0;
lb.lex_abs_pos <- 0;
let lcp = lb.lex_curr_p in
if lcp != dummy_pos then lb.lex_curr_p <- {lcp with pos_cnum = 0};
if lcp != dummy_pos then
lb.lex_curr_p <- {zero_pos with pos_fname = lcp.pos_fname};
lb.lex_buffer_len <- 0;

0 comments on commit 65c8c79

Please sign in to comment.