From: Clifford Heath Date: 2008-02-04T09:39:58+09:00 Subject: Re: [QUIZ] Parsing JSON (#155) Eric Mahurin wrote: > I was expecting this to work as a proxy to the Treetop parser: > > class JSONParser > def initialize > @parser = JsonParser.new > end > def parse(s) > @parser.parse(StringIO.new(s)).value > end > end You need to pass the string directly, not as a StringIO. Treetop parses a String, not an IO.