MiSawa / xq

Pure rust implementation of jq
MIT License
333 stars 18 forks source link

Support trailing comma in object literal #39

Closed itchyny closed 2 years ago

itchyny commented 2 years ago

This PR add support for trailing comma in object literal.

 $ jq '{foo,bar,}' <<< '{"foo": 1, "bar": 2, "baz": 3}'
{
  "foo": 1,
  "bar": 2
}
 $ jq -n 'module { x: 1, }; .'
null
MiSawa commented 2 years ago

Thank you for the contribution! Hmm, it's interesting that jq doesn't support the trailing comma in bind patterns while supporting it on other places :thinking: