Uniform support for \n, \r\n, \r as line breaks. Fixes #4882. #4895
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes lexer to count lines properly in files with \n, \r\n, and \r line breaks. (\r line breaks are used only in some old or obscure systems, but what the heck.)
Tweaks existing line number counting for (bad but legacy) include/use cases:
reports a warning. Old behavior was to report it on line 2, but really the error (the unexpected end-of-line) is on line 1 so the new behavior (and tweak to existing test) makes it report line 1.
Adds a new
RETVAL
argument toadd_cmdline_test()
to allow tests where execution is expected to fail to still get expected-output comparison, to check that the right errors (and line numbers!) are reported. We should probably eventually move the existing add_failing_test cases to use this mechanism instead, so that they can check the error reported.Adds a gitattributes file that suppresses text processing for the new
*.bin.scad
test files. Those files have sections that are UNIX-style, sections that are Windows-style, and an obscure \r-only section. In theory I think git will preserve them, but they may be too fragile for long-term use. We'll see.