-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
Closed
Labels
A-frontendArea: Compiler frontend (errors, parsing and HIR)Area: Compiler frontend (errors, parsing and HIR)
Description
I do not believe it is really necessary to keep track of both the character and byte offset in codemap and related modules.
Spans and everything else should be using the byte offsets. The only place where character offsets are likely needed is when reporting per line column offset, in that case it should be fairly easy to convert the byte offset from the start of the line to a character offset.
Removing all character offset tracking will likely simply the code somewhat.
Right now when trying to work with code in codemap I'm never quite sure if the offset is a byte or a character offset. Furthermore, at one point I had one offset in a byte offset and the other in a character offset (which is what prompted me to create this report).
Metadata
Metadata
Assignees
Labels
A-frontendArea: Compiler frontend (errors, parsing and HIR)Area: Compiler frontend (errors, parsing and HIR)