]> Git Repo - qemu.git/commit
json: Eliminate lexer state IN_WHITESPACE, pseudo-token JSON_SKIP
authorMarkus Armbruster <[email protected]>
Fri, 31 Aug 2018 07:58:41 +0000 (09:58 +0200)
committerMarkus Armbruster <[email protected]>
Mon, 24 Sep 2018 16:08:07 +0000 (18:08 +0200)
commit1e960b46024d468e76d2f42ddcfa5a9d521db492
treefd23be5e2dc0de6bf1aeec492992f96818d3c86d
parent2ce4ee64c4fe0463c53a99955a3acdaa8a451136
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 <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Message-Id: <20180831075841[email protected]>
qobject/json-lexer.c
qobject/json-parser-int.h
This page took 0.024854 seconds and 4 git commands to generate.