diff --git a/parser.y b/parser.y index f77d6d92..a2c765cd 100644 --- a/parser.y +++ b/parser.y @@ -133,7 +133,7 @@ static block gen_dictpair(block k, block v) { } static block gen_index(block obj, block key) { - return BLOCK(obj, gen_subexp(key), gen_op_simple(INDEX)); + return BLOCK(gen_subexp(key), obj, gen_op_simple(INDEX)); } static block gen_binop(block a, block b, int op) { diff --git a/testdata b/testdata index a3e2e49b..00ecc69f 100644 --- a/testdata +++ b/testdata @@ -464,3 +464,7 @@ unique [min,max,min_by(.),max_by(.)] [] [null,null,null,null] + +.foo[.baz] +{"foo":{"bar":4},"baz":"bar"} +4