summaryrefslogtreecommitdiff
path: root/json-glib/json-parser.c
Commit message (Collapse)AuthorAgeFilesLines
...
* Skip the token check after parsing a nested arrayEmmanuele Bassi2007-09-211-0/+2
| | | | | | Since there cannot be any other token except for the comma, which we eat anyway, there's no point in going through the switch() check after we have finished parsing a nested array.
* Parse JSON arraysEmmanuele Bassi2007-09-211-17/+97
| | | | | | | Add the array parsing code. The parser identifies and builds nested levels of arrays, but the storage is not quite right. That is a problem of the parser object, though, so this can be considered a first raw pass at the problem.
* Top-levels in JSON can only be objects or arraysEmmanuele Bassi2007-09-211-10/+14
| | | | | JSON is an object serialisation format (thanks, RFC4627), so it can only express objects and/or arrays as top-levels.
* Add stubs to JsonParser for actually parsing a JSON streamEmmanuele Bassi2007-09-211-1/+265
| | | | | | | | | | | | | | | | | Initial commit for getting JsonParser to work. Because GScanner API is old and mostly sucks, we need to do some magic with signals. If json_parser_load_from_data() fails, the passed GError will be set with a JSON_PARSER_ERROR code and message; unfortunately, we can't get the nice error message out of GScanner. We can, however, override the default message handler and make it emit a signal on the JsonParser object. So, to make a long story short: the GError passed to the load_from_data() method is filled with a short error message; the *real* error message is passed to the ::error signal handlers so they can actually use it. GScanner should really get a way to retrieve the last error message.
* Initial import of JSON-GLibEmmanuele Bassi2007-09-201-0/+152
JSON-GLib is a JSON parser library written with GLib and GObject. JSON is the JavaScript Object Notation, and it's used to define objects and object hierarchies in a human-readable way.