[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 5/6] json: Eliminate lexer state IN_ERROR
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] [PATCH 5/6] json: Eliminate lexer state IN_ERROR |
Date: |
Tue, 28 Aug 2018 06:40:03 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) |
Eric Blake <address@hidden> writes:
> On 08/27/2018 02:00 AM, Markus Armbruster wrote:
>> Signed-off-by: Markus Armbruster <address@hidden>
>> ---
>> qobject/json-lexer.c | 9 +++++----
>> qobject/json-parser-int.h | 8 ++++----
>> 2 files changed, 9 insertions(+), 8 deletions(-)
>
>> -
>> typedef enum json_token_type {
>> - JSON_MIN = 100,
>> - JSON_LCURLY = JSON_MIN,
>> + JSON_ERROR = 0, /* must be zero, see json_lexer[] */
>> + /* Gap for lexer states */
>> + JSON_LCURLY = 100,
>> + JSON_MIN = JSON_LCURLY,
>
> In an earlier version of this type of cleanup, you swapped the IN_ and
> JSON_ values and eliminated the gap, to make the overall table more
> compact (no storage wasted on any of the states in the gap between the
> two).
>
> https://lists.gnu.org/archive/html/qemu-devel/2018-08/msg01178.html
>
> Is it still worth trying to minimize the gap between the two
> sequences, even if you now no longer swap them in order?
You caught me :)
Eliminating the gap actually enlarges the table. I first got confused,
then measured the size change backwards to confirm my confused ideas.
When I looked at the patch again, I realized my mistake, and silently
dropped this part of the change.
- Re: [Qemu-devel] [PATCH 2/6] json: Clean up how lexer consumes "end of input", (continued)
[Qemu-devel] [PATCH 6/6] json: Eliminate lexer state IN_WHITESPACE, pseudo-token JSON_SKIP, Markus Armbruster, 2018/08/27