qemu/include/qapi/qmp
Markus Armbruster 2cbd15aa6f json: Treat unwanted interpolation as lexical error
The JSON parser optionally supports interpolation.  The lexer
recognizes interpolation tokens unconditionally.  The parser rejects
them when interpolation is disabled, in parse_interpolation().
However, it neglects to set an error then, which can make
json_parser_parse() fail without setting an error.

Move the check for unwanted interpolation from the parser's
parse_interpolation() into the lexer's finite state machine.  When
interpolation is disabled, '%' is now handled like any other
unexpected character.

The next commit will improve how such lexical errors are handled.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20180823164025.12553-39-armbru@redhat.com>
2018-08-24 20:26:37 +02:00
..
dispatch.h qmp: Use QDict * instead of QObject * for response objects 2018-07-03 23:18:56 +02:00
json-lexer.h json: Treat unwanted interpolation as lexical error 2018-08-24 20:26:37 +02:00
json-parser.h json: Redesign the callback to consume JSON values 2018-08-24 20:26:37 +02:00
json-streamer.h json: Redesign the callback to consume JSON values 2018-08-24 20:26:37 +02:00
qbool.h qobject: use a QObjectBase_ struct 2018-05-04 08:27:53 +02:00
qdict.h block: Add block-specific QDict header 2018-06-15 14:49:44 +02:00
qerror.h qmp: Eliminate silly QERR_QMP_* macros 2017-03-05 09:14:19 +01:00
qjson.h qobject: qobject_from_jsonv() is dangerous, hide it away 2018-08-16 08:42:06 +02:00
qlist.h qobject: use a QObjectBase_ struct 2018-05-04 08:27:53 +02:00
qlit.h qlit: add qobject_from_qlit() 2018-03-19 10:00:14 -05:00
qnull.h qobject: Modify qobject_ref() to return obj 2018-05-04 08:27:53 +02:00
qnum.h qobject: use a QObjectBase_ struct 2018-05-04 08:27:53 +02:00
qobject.h qobject: Modify qobject_ref() to return obj 2018-05-04 08:27:53 +02:00
qstring.h qstring: Fix qstring_from_substr() not to provoke int overflow 2018-07-28 09:09:58 +02:00