gopls/internal/util/asm: preserve offsets in CRLF files
bufio.ScanLines removes the carriage return from CRLF line tokens.
The assembly parser previously advanced its source offset using the
length of the stripped token plus one byte for '\n'. As a result,
identifier offsets drifted left by one byte for every preceding CRLF
line.
Range directly over the raw lines returned by bytes.SplitSeq. Advance
the source offset using each raw line's length, and strip a trailing
carriage return only from the text used for parsing.
Add LF and CRLF regression tests that verify identifier offsets and
TEXT function boundaries.
Fixes golang/go#80666
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |