mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-26 20:03:54 -06:00
json: Eliminate lexer state IN_WHITESPACE, pseudo-token JSON_SKIP
The lexer ignores whitespace like this: on whitespace on non-ws spontaneously IN_START --> IN_WHITESPACE --> JSON_SKIP --> IN_START ^ | \__/ on whitespace This accumulates a whitespace token in state IN_WHITESPACE, only to throw it away on the transition via JSON_SKIP to the start state. Wasteful. Go from IN_START to IN_START on whitespace directly, dropping the whitespace character. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20180831075841.13363-7-armbru@redhat.com>
This commit is contained in:
parent
2ce4ee64c4
commit
1e960b4602
2 changed files with 5 additions and 18 deletions
|
@ -31,7 +31,6 @@ typedef enum json_token_type {
|
|||
JSON_KEYWORD,
|
||||
JSON_STRING,
|
||||
JSON_INTERP,
|
||||
JSON_SKIP,
|
||||
JSON_END_OF_INPUT,
|
||||
JSON_MAX = JSON_END_OF_INPUT
|
||||
} JSONTokenType;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue