[Git][monnier/typer][main] 2 commits: Fix off by one error on line numbers.
Simon Génier pushed to branch main at Stefan / Typer Commits: cc46ac0a by Simon Génier at 2022-09-02T14:34:57-04:00 Fix off by one error on line numbers. The source_file object start in a kind of null state, with an empty line, causing to read the first line lazily as the first char is peeked. This means we need to put the cursor before the first line and not on the first line! - - - - - 29c3f091 by Simon Génier at 2022-09-02T14:36:31-04:00 Merge branch 'oops-fix-off-by-one-error-on-line-numbers' - - - - - 1 changed file: - src/source.ml Changes: ===================================== src/source.ml ===================================== @@ -1,4 +1,4 @@ -(* Copyright (C) 2021 Free Software Foundation, Inc. +(* Copyright (C) 2021-2022 Free Software Foundation, Inc. * * Author: Simon Génier <simon.genier@umontreal.ca> * Keywords: languages, lisp, dependent types. @@ -162,7 +162,7 @@ end let read_buffer_length = 4096 class source_file file_name = object (self) - inherit t first_line_of_file first_column_of_line file_name + inherit t (first_line_of_file - 1) first_column_of_line file_name val in_channel = open_in file_name val mutable end_of_line = false View it on GitLab: https://gitlab.com/monnier/typer/-/compare/2a824e2d1539ab7a2a4ba998fbb4ac656... -- View it on GitLab: https://gitlab.com/monnier/typer/-/compare/2a824e2d1539ab7a2a4ba998fbb4ac656... You're receiving this email because of your account on gitlab.com.
Afficher les réponses par date
participants (1)
-
Simon Génier (@ilovemonoids)