Parse the parameters of a function call, either the caller has supplied JSON data, or the caller has supplied
another path expression which must be evaluated and in turn invoked against the root document. In this tokenizer
we're only concerned with parsing the path thus the output of this function is a list of parameters with the Path
set if the parameter is an expression. If the parameter is a JSON document then the value of the cachedValue is
set on the object.
Sequence for parsing out the parameters:
This code has its own tokenizer - it does some rudimentary level of lexing in that it can distinguish between JSON block parameters
and sub-JSON blocks - it effectively regex's out the parameters into string blocks that can then be passed along to the appropriate parser.
Since sub-jsonpath expressions can themselves contain other function calls this routine needs to be sensitive to token counting to
determine the boundaries. Since the Path parser isn't aware of JSON processing this uber routine is needed.
Parameters are separated by COMMAs ','
doc = {"numbers": [1,2,3,4,5,6,7,8,9,10]}
$.sum({10}, $.numbers.avg())
The above is a valid function call, we're first summing 10 + avg of 1...10 (5.5) so the total should be 15.5