Skip to content

.foo.[] is a syntax error (but not .foo | .[] or .foo[]) #1699

Closed
@Ekleog

Description

@Ekleog

Hello,

First, thank you for your work on jq!

As I couldn't find any issue matching “.[]”, I thought I'd open this: jq '.foo | .[]' works as expected, but jq '.foo.[]' barfs out a syntax error (actually, jq '.foo[]' works too). It's not a big deal given there's the alternative syntax, but it's not really intuitive (as .a.b and .a | .b are equivalent as per the docs), and at first I thought I had got the .[] wrong. :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions