jdegoes / blueeyes

A lightweight Web 3.0 framework for Scala, featuring a purely asynchronous architecture, extremely high-performance, massive scalability, high usability, and a functional, composable design.
github.com/jdegoes/blueeyes
738 stars 46 forks source link

Extend JPath to accept quoted string references #128

Closed noelwelsh closed 11 years ago

noelwelsh commented 11 years ago

JPath syntax is now (roughly)

jPath := pathElement pathElement := id | quotedField | numericField id := .[a-zA-Z$][a-zA-Z$0-9] quotedField := ['quotedId'] | ["quotedId"] numericField := []

quotedId is a string with \ used as an escape character.

The first element of a jPath need not start with a . if it is an id

Example:

foo['bar bar']["black sheep"] is a valid reference into

{"foo": {"bar bar": {"black sheep": "aValue"}}}

precog-zombie commented 11 years ago

Can one of the admins verify this patch?

noelwelsh commented 11 years ago

Thanks!