Skip to content

Instantly share code, notes, and snippets.

@kriszyp
Created June 29, 2010 01:17
Show Gist options
  • Save kriszyp/456646 to your computer and use it in GitHub Desktop.
Save kriszyp/456646 to your computer and use it in GitHub Desktop.
query = and
# Normalized components
nchar = unreserved / pct-encoded
name = *nchar
value = *nchar / typed-value / array
typed-value = *nchar ":" *nchar
array = "(" [ value *( "," value ) ] ")"
call = name "(" [ argument *( "," argument ) ] ")"
argument = call / value
pct-encoded = "%" HEXDIG HEXDIG
unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
# Sugar components
comparison = name ( "=" [ name "=" ] ) value
operator = comparison / call / group
and = operator *( "&" operator )
or = operator *( "|" operator )
group = "(" ( and / or ) ")"
@deanlandolt
Copy link

Wow, this is surprisingly short!

I don't see anything re: the sugar ops like >, <=, and the FIQL stuff but I guess that isn't strictly necessary.

Does query = and suggest that the top level can only & terms together? That keeps things simple.

Are those really the only unreserved chars available? Perhaps it's safer to specify unreserved than to go short on a list of reserved chars.

@kriszyp
Copy link
Author

kriszyp commented Jun 29, 2010

I didn't think we could formally have < and > as part of RQL since they aren't URI delimiters, but maybe we can.

The standard FIQL syntax is handled by the "comparison" construct.

I think that "*" and "+" should be added to the unreserved or nchar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment