davidcox/genson — Issue #22: Failure to parse certain binary op instances
Author: yamins81
Created: 2011-10-21 18:11:24+00:00
State: open

The following I think legal genson string fails to parse:

s = '{"p0":gaussian(1+1,1)}'

Here's the full error trace

In [247]: genson.loads(s)
---------------------------------------------------------------------------
ParseException Traceback (most recent call last)

/Users/dyamins/genson/ in ()

/Users/dyamins/genson/genson/__init__.pyc in loads(genson_string)
64 def loads(genson_string):
65 parser = GENSONParser()
---> 66 genson_dict = parser.parse_string(genson_string)
67 return JSONGenerator(genson_dict)
68

/Users/dyamins/genson/genson/parser.pyc in parse_string(self, genson_string)
202
203 def parse_string(self, genson_string):
--> 204 result = self.grammar.parseString(genson_string)
205 return result.asList()[0]
206

/usr/local/Cellar/python/2.7/lib/python2.7/site-packages/pyparsing-1.5.6-py2.7.egg/pyparsing.pyc in parseString(self, instring, parseAll)
1030 # catch and re-raise exception from here, clears out pyparsing internal stack trace

1031 exc = sys.exc_info()[1]
-> 1032 raise exc
1033 else:
1034 return tokens

ParseException: Expected ")" (at char 16), (line:1, col:17)