Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define descendant list semantics #233

Merged
merged 3 commits into from
Aug 23, 2022
Merged

Define descendant list semantics #233

merged 3 commits into from
Aug 23, 2022

Conversation

glyn
Copy link
Collaborator

@glyn glyn commented Aug 8, 2022

Also tweak the wording of the list semantics section.

Fixes #232

Reviewers may find the rendered version useful.

@glyn glyn self-assigned this Aug 8, 2022
@glyn glyn requested review from timbray, gregsdennis and cabo August 8, 2022 11:51
* the `..[<filter>]` form selects those descendants that are array elements or object values selected by the given filter.
* the `..[*]` and `..*` forms select all the descendants.

An _array-sequenced preorder_ of the descendants of a node is a sequence of all the descendants in which:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR removes the need for the term "array-sequenced preorder" by talking instead about a nodelist of the descendants with the same properties. I think this is easier to read and gives the same ordering properties.

@@ -1326,7 +1326,7 @@ list-entry = ( quoted-member-name /
#### Semantics
{: unnumbered}

A list selector selects the nodes that are selected by at least one of
A list selector selects the nodes that are selected by
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Major semantics change here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That wasn't my intention. The "at least one of" wording was vestigial and related to when we were considering removing duplicates. Now that duplicate nodes and values are retained, the wording is no longer needed.

Or am I missing something?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a change fixing vestigial text

@glyn glyn requested a review from timbray August 10, 2022 14:59
@glyn glyn force-pushed the 232-descendant-list-semantics branch 2 times, most recently from c7c833d to 4101d7b Compare August 20, 2022 14:02
@glyn
Copy link
Collaborator Author

glyn commented Aug 22, 2022

@timbray Just a gentle reminder to re-review as I'd like to get this PR merged. Thanks.

@glyn glyn force-pushed the 232-descendant-list-semantics branch from 4101d7b to 32d279e Compare August 22, 2022 18:54

* nodes of any array appear in array order,
* nodes appear immediately before all their descendants.

This definition does not stipulate the order in which the children of an object appear, since JSON objects are unordered.
This definition does not stipulate the order in which the children of an object appear, since
JSON objects are unordered.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Slightly more correct I think: The order of the members in a JSON object is not information-bearing.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sentence "The order of the members in a JSON object is not information-bearing." is a bit tricky because it refers to "The order of the members in a JSON object" as if that was somehow well defined. Also, I'm not sure how many people would understand the sentence because the term "information-bearing" is a little unusual. I think I'll stick with the informal language for now.

@glyn glyn merged commit 8c108f9 into main Aug 23, 2022
@glyn glyn deleted the 232-descendant-list-semantics branch August 23, 2022 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Semantics of the list form of descendant selector
3 participants