Skip to content

Commit

Permalink
simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
gpetiot committed Feb 18, 2020
1 parent 4ffff85 commit 521d3e0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/Source.ml
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ let indentation_of_index t idx =
match String.split_lines t with
| [] -> None
| lines ->
let rec aux wc_acc ln = function
let rec aux wc_acc = function
| [] -> None
| h :: t ->
if idx < wc_acc + String.length h then
Some (String.length h - String.(length (lstrip h)))
else aux (wc_acc + String.length h) (ln + 1) t
else aux (wc_acc + String.length h) t
in
aux 0 1 lines
aux 0 lines

let position_before t (pos : Lexing.position) =
let is_closing c =
Expand Down

0 comments on commit 521d3e0

Please sign in to comment.