From 1e960b46024d468e76d2f42ddcfa5a9d521db492 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Fri, 31 Aug 2018 09:58:41 +0200 Subject: 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 Reviewed-by: Eric Blake Message-Id: <20180831075841.13363-7-armbru@redhat.com> --- qobject/json-parser-int.h | 1 - 1 file changed, 1 deletion(-) (limited to 'qobject/json-parser-int.h') diff --git a/qobject/json-parser-int.h b/qobject/json-parser-int.h index 57cb8e7..16a25d0 100644 --- a/qobject/json-parser-int.h +++ b/qobject/json-parser-int.h @@ -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; -- cgit v1.1