This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
This bug is very similar to bug 9832, however since that bug is discussing a lot of related issues, I wanted to file a separate one to make sure this isn't forgotten. Currently the syntax for parsing a keyPath isn't explicitly defined. It is clear that for keypath/object "foo.bar.baz" { foo: { bar: { baz: 4 } } } the result is 4. However does keypath/object "foo[1].bar" { foo: [ false, { bar: 4 }, true ] } evaluate to 4? What about "foo[x].bar" { foo: [ { bar: 4 } ], x: 0 } or "" 4 Do either of those evaluate to 4? The last example could be useful when out-of-line keys are used, but still wanting to be able to search on the stored value.
A couple of more keypath/object edge cases that needs to be defined: "foo[1]" { foo: [12, 13] } "foo[5]" { foo: [12, 13] } "foo.1" { foo: [12, 13] } (i.e. is this a syntax error or not?) "[1]" [12, 13]
We decided on this in some thread: <identifier> ["." <identifier>]* Where identifier is basically a JavaScript identifier (which I believe is something like this: [a-zA-Z_][a-zA-Z0-9_]* But I'm hoping we can avoid speccing this later part ourselves.
*** Bug 9832 has been marked as a duplicate of this bug. ***