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
Failure to parse .x.["y.z"] notation #1168
Comments
Trials with 2-part ("z.y") versus 3-part ("z.y.x") key
|
The syntax is either
So, you may be wondering: how come |
Great, that completely addresses my question, thank you. Good to close. For the sake of completeness, it looks like the dot must be elided.
|
Yes, that is correct: the dot must be elided. I misspoke in my earlier comment. |
This seems to be a documentation issue. The reference documentation
This appears to be true only if the dot is at the start. There |
I'll agree that it's a documentation issue, but the real issue is that we
may not be properly explaining what the dot is doing there. The dot means
"the input", and then you're indexing with [], so subsequent indexes in a
chain don't need to have a dot, since they're indexing off of the result.
In fact, as you've noticed, using the dot results in a syntax error. :)
…On Thu, May 11, 2017, 07:31 Roger Peppe ***@***.***> wrote:
This seems to be a documentation issue. The reference documentation
describes the operator as .[0] and says:
When the index value is an integer, .[<value>] can index arrays
This appears to be true only if the dot is at the start. There
are no examples of an array index not at the start, and no
indications that I've found that the dot is not allowed in that
case.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1168 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ADQ4V0NFWrbe-Lw4XpL8ivJLHBBeqoSWks5r4vGBgaJpZM4I7A3Y>
.
|
My question is: should we add |
This is something I recently ran into, as well. Simplified examples using JQPlay: With dot (syntax error): Without dot (happy): Is this something that there is a concrete reason behind disallowing? Or is it just a limitation of the current implementation? Wording my question another way: Is there any reason that supporting this in the future would be explicitly unwanted? |
@MondayHopscotch There is no limitation of the current implementation that makes this difficult to support. As to reasons not to support this, I don't think there are any, and this is a very very FAQ. This trivial patch adds support for this:
|
@wtlangford any objections to pushing that patch? |
Perhaps the real issue here is that the documentation doesn't explain the grammar clearly. I can't see anything in the documentation that mentions that
AFAICS One other thing: |
There is certainly a bug in the manual...
|
I've pushed 3e0a118 to allow |
ubuntu-22.04 runners use jq 1.6 which doesn't recognize a dot for `[]` value iterator. See: jqlang/jq#1168.
ubuntu-22.04 runners use jq 1.6 which doesn't recognize a dot for `[]` value iterator. See: jqlang/jq#1168.
ubuntu-22.04 runners use jq 1.6 which doesn't recognize a dot for `[]` value iterator. See: jqlang/jq#1168.
* build: Get Read the Docs release number from Cargo manifest This avoids hardcoding the release number in the documentation build config, making it easier to bump the version by only modifying the manifest. * build: Require Python 3.11 in Read the Docs configuration Python 3.11 is needed to access tomllib; useful for parsing the Cargo manifest file. * feat: Create branch, bump version and tag in release workflow * feat: Add publish-github job * fix: Broken tag dependencies * chore: Remove enforce-linking-issues workflow * fix: Bump version in pyproject.toml * chore: Upgrade artifact actions from v3 to v4 * fix: Typo in git-commit command * fix: Support jq 1.6 ubuntu-22.04 runners use jq 1.6 which doesn't recognize a dot for `[]` value iterator. See: jqlang/jq#1168. * Revert "chore: Upgrade artifact actions from v3 to v4" This reverts commit a535971. * fix: Build wheels from release branch * fix: Switch to pypa/gh-action-pypi-publish@release/v1 The older actions doesn't recognize the pyproject.toml metadata fields.
* feat: Store project version in version.txt * fix: Remove cargo-deb metadata section in `zenoh-jni` * feat: Add `bump-and-tag.bash` script * chore: Rename release workflow to pre-release * chore: Disable release event on publish workflows * fix: Typo in ci/scripts * feat: Automate Release * chore: Remove enforce-linking-issues workflow * fix: Set permissions for publishing jobs * feat: Add publish-dokka to release workflow * fix: Set release branch in publishing jobs * fix: Make `branch` input unrequired in publishing jobs * style: Uniformize publishing workflow names * fix: Unecessary use of `BOT_TOKEN_WORKFLOW` * fix: Incorrect Cargo manifest/lockfile path * fix: Add missing `live-run` input for publish-dokka job * fix: Typo in pre-release workflow name * fix: Remove `if: always()` in publish-github job * fix: Remove unecessary SSH passphrase/privatekey inputs * chore: Retrigger CI * fix: Support jq 1.6 ubuntu-22.04 runners use jq 1.6 which doesn't recognize a dot for `[]` value iterator. See: jqlang/jq#1168.
* build: Get Read the Docs release number from Cargo manifest This avoids hardcoding the release number in the documentation build config, making it easier to bump the version by only modifying the manifest. * build: Require Python 3.11 in Read the Docs configuration Python 3.11 is needed to access tomllib; useful for parsing the Cargo manifest file. * feat: Create branch, bump version and tag in release workflow * feat: Add publish-github job * fix: Broken tag dependencies * chore: Remove enforce-linking-issues workflow * fix: Bump version in pyproject.toml * chore: Upgrade artifact actions from v3 to v4 * fix: Typo in git-commit command * fix: Support jq 1.6 ubuntu-22.04 runners use jq 1.6 which doesn't recognize a dot for `[]` value iterator. See: jqlang/jq#1168. * Revert "chore: Upgrade artifact actions from v3 to v4" This reverts commit a535971. * fix: Build wheels from release branch * fix: Switch to pypa/gh-action-pypi-publish@release/v1 The older actions doesn't recognize the pyproject.toml metadata fields.
mcint@work MINGW64 /c/git
The document
The complex key
One naive approach
Solution proposed by the docs
Work-around
Boundaries of quoted key solution
The text was updated successfully, but these errors were encountered: