scala3
scala3 copied to clipboard
Fix span of xml literal
Forward port https://github.com/scala/scala/commit/f428cc6d94bbfee6ba3f7a956d0eee7126d785af Forward port https://github.com/scala/scala/commit/85136e3f2591f0bf22d3845ecc83081a0b6c4aa4
The dotty reader has lastCharOffset to track where the last char began. There is no need to back up to it.
It turns out you have to wait a while to see the CB output because of the copious tree printing.

@prolativ Perhaps you could approve. I highlighted the delta. I haven't looked at the linked draft yet.
This looks good in general but I would advocate for not merging any changes without tests. Also, I can recall some discussion about making people always use only \n as the line end marker. @smarter do you remember some more details about that?
\r\n is just line separator on Windows. I see I added ParserEdgeTest a few years ago for similar purposes, I'll add a test there. (The point is to supply source text as a String, since usually git normalizes line endings.)