Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for CRLF line endings in filters #1673

Closed
wants to merge 1 commit into from

Conversation

kvonbredow
Copy link

@kvonbredow kvonbredow commented May 31, 2018

In files created in windows, the CRLF line endings in filters cause jq to crash with an "unexpected INVALID_CHARACTER" syntax error. Since this should just be treated as any other whitespace character to aid in Windows support, I modified the lexer to ignore \r whitespace in filters.

resolves #1219

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.02%) to 84.947% when pulling 5e6b68b on kvonbredow:CRLF_support into 90bc29c on stedolan:master.

@itchyny
Copy link
Contributor

itchyny commented Dec 4, 2023

This issue has been resolved by #2942.

@itchyny itchyny closed this Dec 4, 2023
@emanuele6
Copy link
Member

emanuele6 commented Dec 4, 2023

No, #2942 did not add \r as a whitespace character, it just made it so \r in a comment does not end the comment, and trigger an INVALID_CHARACTER error for CR.
If you have a \r character in your script, the code will still not compile because \r is invalid; but now \r is at least allowed in comments.

@emanuele6
Copy link
Member

Anyhow, this patch probably has conflicts, and extra code would be needed to support # \<cr><lf> comment continuations. So we can keep it closed, I guess.

@itchyny
Copy link
Contributor

itchyny commented Dec 4, 2023

Oops, thanks for comment. That sounds a halfway support, so I'd like to see full support CRLF newlines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support \r as whitespace in filters
4 participants