Skip to content

Commit

Permalink
Also restore lex_abs_pos when parsing junk
Browse files Browse the repository at this point in the history
  • Loading branch information
Leonidas-from-XIV committed May 31, 2024
1 parent d9eaf76 commit bdca9d8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/lexer_utils.mll
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ rule read_junk buf n = parse

{
let read_junk_without_positions buf n (lexbuf : Lexing.lexbuf) =
let junk_start_pos = lexbuf.lex_start_pos in
let lex_abs_pos = lexbuf.lex_abs_pos in
let lex_start_pos = lexbuf.lex_start_pos in
read_junk buf n lexbuf;
lexbuf.lex_start_pos <- junk_start_pos + 1
lexbuf.lex_start_pos <- lex_start_pos + 1;
lexbuf.lex_abs_pos <- lex_abs_pos
}

0 comments on commit bdca9d8

Please sign in to comment.