QueryResult now stores result items and position data, which aligns more
strongly with the rest of the library features than a plain
[]interface[}. The design of the parser_test unittest was revised to
use array/map/scalar serialization (like match_test), since Go 1.3
redesigned maps to randomly order their keys. Since naive comparisons of
map data is now no longer possible, the unittest now sorts map
keys:value combinations.
* Patched a bug where getPosition("") was returning an invalid Position
* Revised parser_test to use serialization for comparisons for Go 1.3
* Added public Query interface
* Added filter function callback support
* Added "script" function callback support
Queries are generated via Compile(), which then may be run via Execute()
as many times as needed. Much like compiling a regex, this is done to
elide the need to re-parse and build the funciton tree for each
execution.
The distinction between 'filter' and 'script' is borrowed from their
syntactic equivalents in jsonpath. Right now, these accept no arguments
in the query, and instead merely pass the current node to the callback.
Filters return a bool and determine if the node is kept or culled out.
'Scripts' return a string or an in64, which is in turn used in an index
or key filter (respectively) on the current node's data.
A few callbacks are provided by default, with the ability to add
additional callbacks before calling Execute() on a compiled query.