Skip to content

Commit

Permalink
fixing an off by 1 error
Browse files Browse the repository at this point in the history
  • Loading branch information
aseemr committed Mar 20, 2023
1 parent 5fcec9d commit ff030ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ocaml/fstar-lib/FStar_Parser_ParseIt.ml
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ let parse fn =
let contents_at =
let lines = U.splitlines contents in
fun (start_pos:Lexing.position) (end_pos:Lexing.position) ->
let suffix = FStar_Compiler_Util.nth_tail (Z.of_int (start_pos.pos_lnum - 1)) lines in
let suffix = FStar_Compiler_Util.nth_tail (Z.of_int start_pos.pos_lnum) lines in
let text, _ = FStar_Compiler_Util.first_N (Z.of_int (end_pos.pos_lnum - start_pos.pos_lnum)) suffix in
let range = range_of_positions start_pos end_pos in
{ range;
Expand Down

0 comments on commit ff030ad

Please sign in to comment.