jmespath-community / jmespath.spec

JMESPath Specification
6 stars 3 forks source link

`list-filter-expr` is a `bracket-specifier`. #76

Closed springcomp closed 2 years ago

springcomp commented 2 years ago

The current GRAMMAR does not allow expressions like:

foo[?bar == 'baz']

As it would parse as an identifier followed by a list-filter-expr. However, this expression is perfectly valid and supported in all current library implementations. This suggests that the grammar is slightly wrong.

This PR changes the grammar like so:

In effect, this turns the referred to expression above as an index-expression.

innovate-invent commented 2 years ago

At this point we should rename index-expression to bracket-expression.

innovate-invent commented 2 years ago

For the CI failures, I think we need to set warnings.simplefilter("ignore", ReusedAnchorWarning) for check-jsonschema

springcomp commented 2 years ago

At this point we should rename index-expression to bracket-expression.

I can do this in an another PR.

springcomp commented 2 years ago

For the CI failures, I think we need to set warnings.simplefilter("ignore", ReusedAnchorWarning) for check-jsonschema

Do you suggest I go ahead with this change?

innovate-invent commented 2 years ago

Do you suggest I go ahead with this change?

I might be able to look at it later today, but you are welcome to beat me to it.

innovate-invent commented 2 years ago

Would you prefer to just merge this or should we look into breaking up bracket-specifier? Especially given https://github.com/jmespath-community/jmespath.spec/discussions/82

springcomp commented 2 years ago

Would you prefer to just merge this or should we look into breaking up bracket-specifier? Especially given #82

I think we should merge this as this is a bug with regards to the official grammar. The other change is more controversial as it involves changing the grammar to match an existing - possibly unintended - behavior.