lean4 icon indicating copy to clipboard operation
lean4 copied to clipboard

chore: remove FileMap.lines and add FileMap.getLine

Open joneugster opened this issue 1 year ago • 2 comments

FileMap.lines is an array that seems to be manually managed to have the form #[1, 2, ..., n-1, n-1] with same length as FileMap.positions. Remove this structure field in favour of calculating the line number as min(x+1, positions.size-1) when needed.

Follow-up on #3221

joneugster avatar Feb 01 '24 12:02 joneugster

a) I'm a bit surprised that FileMap.lines seems not to be used anywhere else in the code.

joneugster avatar Feb 01 '24 12:02 joneugster

Mathlib CI status (docs):

@Kha if you want to review/adapt this PR you requested in #3221, please feel free to do so. Otherwise, I'll close it next week as part of cleaning up my open PRs.

joneugster avatar Mar 24 '24 02:03 joneugster

Thanks for the reminder!

Kha avatar Mar 25 '24 10:03 Kha