summaryrefslogtreecommitdiff
path: root/json-glib/json-scanner.c
Commit message (Collapse)AuthorAgeFilesLines
* Initialise all missing struct fieldsEmmanuele Bassi2022-10-111-37/+38
| | | | Avoid compiler warnings.
* scanner: Fix crash on malformed surrogate pairsJames Westman2020-11-301-4/+24
| | | | | | | | | | | JSON-GLib would crash when trying to decode escaped Unicode characters, if a character of a surrogate pair was detected but it was in the wrong range, or if the following character was not in the correct range. Fixed by emitting an error ("Parse error: scanner: malformed surrogate pair") before the assertion is run. Fixes #26.
* scanner: use macro instead of cast to convert pointer to integerDimitry Andric2020-08-191-1/+1
| | | | | | | | | Clang 11 build failed due to a new warning (part of -Werror=pointer-to-int-cast): ../json-glib/json-scanner.c:928:13: error: cast to smaller integer type 'GTokenType' from 'gpointer' (aka 'void *') [-Werror,-Wvoid-pointer-to-enum-cast] *token_p = (GTokenType) value_p->v_symbol; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Jan Beich <jbeich@FreeBSD.org>
* json-glib: Remove unused symbolsThibault Saunier2017-03-131-19/+0
| | | | | | Or compilation fails with -Werror https://bugzilla.gnome.org/show_bug.cgi?id=773604
* Remove conditional inclusion of config.hEmmanuele Bassi2014-03-181-2/+0
| | | | All the platforms and build system we support have a config.h header.
* scanner: Clean up the UTF-16 surrogate pairs decodingEmmanuele Bassi2014-03-181-6/+36
| | | | | | We over-assert() our pre-conditions, and the conversion is a bit obfuscated. We should use a proper function, and de-obfuscate the code so that the intent is clear.
* Updated FSF's addressDaniel Mustieles2014-01-311-3/+1
|
* scanner: Remove unused functionsEmmanuele Bassi2012-10-261-359/+34
| | | | | | | | JsonScanner is an internal, modified copy of GScanner; we don't need a bunch of the provided functions, as the type and its related API are meant for internal use only. Fewer functions == better coverage == less code to maintain.
* Support for surrogate pairs in json string.Eiichi Sato2010-04-151-1/+15
| | | | | | https://bugzilla.gnome.org/show_bug.cgi?id=615799 Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
* Actually use the int64 support in the ScannerEmmanuele Bassi2009-08-121-0/+1
| | | | | | | | We switched everything to 64 bit integers but then I forgot to enable the support for actually making the tokenizer store the parsed integers into a 64 bit value. Bad Emmanuele, no cookie for you.
* Add support for parsing \uXXXX into UnicodeEmmanuele Bassi2008-04-191-6/+50
| | | | | | | | | | | | JsonScanner was forked from GScanner in order to support the JSON-specific Unicode escaping. JsonScanner now intercepts the \u escape character and, if it is followed by a hexadecimal value, it will retrieve the Unicode character encoded in the following 4 values and insert the character itself in the buffer. This allows full compatibility with JSON.
* Sanitize JsonScanner codeEmmanuele Bassi2008-02-291-22/+20
| | | | | | | Use a closure instead of (*eugh*) an array of gpointers and casting to void*. Also, use the Slice allocator for the ScannerKey structs.
* Completely internalize the JsonScannerEmmanuele Bassi2008-02-291-316/+323
| | | | | Rename all the API and the data types to the Json namespace, so we can use the internal copy instead of GScanner.
* Update the JsonScanner default configurationEmmanuele Bassi2008-02-291-48/+36
|
* Copy GScanner into JSON-GLib as JsonScannerEmmanuele Bassi2008-02-291-0/+1809
Instead of writing our tokenizer we can fork GScanner and make a specialized version for JSON (as per RFC), luckily the licenses are compatible (LGPLv2.1 with "any later" clause). GScanner does not support Unicode "\uNNNN" escaping and we need to ensure UTF-8 strings as well. The API will mostly be the same, but the generic bits not used by JsonParser will be hidden: this is, after all, a specialized tokenizer.