Regardless of whether the source is Unix (\n) or DOS (\r\n), the lines will end with \n.
Regardless of whether the source is Unix (\n) or DOS (\r\n), the lines will end with \n. We split on \n and allow an optional trailing \r on the line. This lets us split on lines while keep the source positions matching up.