1
0
mirror of https://github.com/stedolan/jq.git synced 2024-05-11 05:55:39 +00:00

9 Commits

Author SHA1 Message Date
3d49fc59dd Implement flatten/0 in terms of flatten/1 2015-07-24 21:55:43 -07:00
16e8d0b1ab detect invalid path expression (fix #862) 2015-07-24 20:23:07 -07:00
66ef8e2c24 Resolve shift/reduce conflict of 'def' vs '|'
This was an important conflict. In the following expression:

    def a: 0; . | a

Bison needs to decide between these two equally valid
parses:

    (def a: 0; .) | a
    def a: 0; (. | a)

For jq we want the second one, because the first results in
"a/0 is not defined". In the current parser the first parse
is a reduce and the second parse is a shift. Since Bison
prefers to shift in shift/reduce conflicts, we accidentally
got the correct behavior.

This commit adds a precedence level FUNCDEF which is lower
precedence than '|', meaning we explicitly choose the
correct parse.

Of course many unit tests already cover this case, but I
added one specifically for it.
2015-07-19 09:42:01 -07:00
579518c78d Use include for import into namespace 2015-07-10 10:19:33 -05:00
6e27de4f74 strftime wrong day-of-week (fix #838) 2015-07-01 20:37:16 -07:00
fd4f4f2087 Make --run-tests' jv_test() quiet 2015-06-28 13:39:32 -05:00
32c4759e6b Add more basic number tests 2015-06-27 23:15:16 -05:00
aaf305868c Restore import into caller's namespace 2015-06-26 23:40:37 -05:00
1146b8b84a separate jq, oniguruma, sh, and man tests 2015-06-18 23:55:43 -05:00