gh-159465: Improve incomplete input detection (#159466)

* gh-159465: Improve incomplete input detection

* gh-159465: Track newline effects and preserve parser layout

* gh-159465: Share incomplete-input error cleanup
25 files changed