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:
4
parser.y
4
parser.y
@ -458,7 +458,9 @@ ExpD:
|
||||
ExpD '|' ExpD {
|
||||
$$ = block_join($1, $3);
|
||||
} |
|
||||
|
||||
'-' ExpD {
|
||||
$$ = BLOCK($2, gen_call("_negate", gen_noop()));
|
||||
} |
|
||||
Term {
|
||||
$$ = $1;
|
||||
}
|
||||
|
@ -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.
|
||||
|
Reference in New Issue
Block a user