Skip to content

Support \r as whitespace in filters #1219

@jcracknell

Description

@jcracknell
jq -n "$(echo -e "1\n+\n2")"
3    
jq -n "$(echo -e "1\r\n+\r\n2")"
jq: error: syntax error, unexpected INVALID_CHARACTER, expecting $end (Unix shell quoting issues?) at <top-level>, line 1:

jq: 1 compile error

Is there a particular reason for this? I spent a while banging my head on this trying to call jq from a powershell script.

Edit: looking at lexer.l, there may also be an issue with carriage returns in comments. I would argue a comment should only end on a line feed character, and not on a solitary \r.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions