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

Allow negated object values without parens. Fixes #247

This commit is contained in:
Stephen Dolan
2013-12-17 22:28:26 +00:00
parent 0966230ba8
commit 18e828f17c
2 changed files with 7 additions and 1 deletions

View File

@ -458,7 +458,9 @@ ExpD:
ExpD '|' ExpD {
$$ = block_join($1, $3);
} |
'-' ExpD {
$$ = BLOCK($2, gen_call("_negate", gen_noop()));
} |
Term {
$$ = $1;
}

View File

@ -36,6 +36,10 @@ null
null
[]
{x: -1}
null
{"x": -1}
# The input line starts with a 0xFEFF (byte order mark) codepoint
# No, there is no reason to have a byte order mark in UTF8 text.
# But apparently people do, so jq shouldn't break on it.