| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Avoid compiler warnings.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
Or compilation fails with -Werror
https://bugzilla.gnome.org/show_bug.cgi?id=773604
|
|
|
|
| |
All the platforms and build system we support have a config.h header.
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
https://bugzilla.gnome.org/show_bug.cgi?id=615799
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
Use a closure instead of (*eugh*) an array of gpointers and casting
to void*.
Also, use the Slice allocator for the ScannerKey structs.
|
|
|
|
|
| |
Rename all the API and the data types to the Json namespace, so we can
use the internal copy instead of GScanner.
|
| |
|
|
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.
|