Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp512626imu; Tue, 11 Dec 2018 03:05:29 -0800 (PST) X-Google-Smtp-Source: AFSGD/VSznSAxEF2LZO6TkhHPXftWmjXlDfFs5gCclCnLEc1jFXRHV59gdcFXsZWgKBsWyNCdSa+ X-Received: by 2002:a17:902:a5ca:: with SMTP id t10mr15531183plq.139.1544526329464; Tue, 11 Dec 2018 03:05:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544526329; cv=none; d=google.com; s=arc-20160816; b=mrU3Yv9rsryD5v+vhtW0OaTwlKQzAeXIO6kJVSGcS4pTU+ojtgsuuUL6np/mzpmyQX 1i9CT583BkrWghSIraKj7ECT5d8mH0POB/xx935SFo2ByPeJweOaML7UqG2ewysfJtD6 fF7d9XY464ZkuJnn8WnEoIrNl6VYfBRbBf3xJwL7z1Plj28Ueygq1XI2CkuhyE68EaYW bxcl/fmAlcICc3B4DcbmGwsccfpdc9hSJla1B2jlCDamFq0lqw/OIhCzCBNoSzpa/KvL TmoFYYc1Th21cWNmHMJ3S5/4CjtM8erOUxvOu8S2IR4KuxEpmqvn9de5+A5AnD9ff+x9 GzqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=6Lvtg2dB6yAFCoRPqr59hv7P+Ii7lc6zWyJld8N69xA=; b=kzBuA05kHQSRVS2VpUI3bubfNy8XcQW9wXtAJB0GsASH0wPrpVk+nYNgi19FYbHtPt wS+93vKEZ5qNSHK4MRrXNdznRdQAFcGQnk8DyUNcYOWC4Pr5uz6JvHS8KdjOVa/UJoR/ +OApV6IQuUJPAfbFqw1AZJMYuvwv8dzfEXiIhn9qB0XceARcW6hcbEzWxRhNsIwnFyhf Xe0feeY6dZHR65bC6bBlObDTCMOk14K5Q7yziXHe3ghnLaIX6i09l/goCq6X0u4HC6NM e3rVn0VjurNi+FHSOXtyLyMTiHUGvSONYoEx0ZI1XuBv1LUhyof023MVOxpyYNi+lI3F 5phw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b="aw/RnSCy"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e2si9715290pgs.94.2018.12.11.03.05.14; Tue, 11 Dec 2018 03:05:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b="aw/RnSCy"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726808AbeLKLCZ (ORCPT + 99 others); Tue, 11 Dec 2018 06:02:25 -0500 Received: from conuserg-11.nifty.com ([210.131.2.78]:36854 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726706AbeLKLBs (ORCPT ); Tue, 11 Dec 2018 06:01:48 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id wBBB1C62017210; Tue, 11 Dec 2018 20:01:31 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com wBBB1C62017210 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1544526091; bh=6Lvtg2dB6yAFCoRPqr59hv7P+Ii7lc6zWyJld8N69xA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aw/RnSCyPCDBoQLgHMgFn4RzvL+v3J93fGMiglKTHAW42E71T8ru8RRRWQHU1x0oE yFSBBbLw7TfUM+4rjrb1PXKR8e7LBC3LyeZGxEQNMKxhUiHrjDTSrSW8CnGOjT+BPe kYMFohGGSZmXG8gGAAYGm2pBgDhw5pCRmr9BWuoO7VhhyVVRPqSo/SoxnTCy/NpQxV RU0wZ1uBEAFUn9BIN0nIWfDjGIPvByFxJVVzhE7xRbDEGDfICqBQ2za0kEOZ1ZqAQn INjifWIrVhI02JQpXivFjSSrcEBeA8wVCn1vDv1aRcL94X62Elu57aDSJ00V5O7wdQ Mpoe3EpIO+a9w== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Ulf Magnusson , linux-kernel@vger.kernel.org, Masahiro Yamada Subject: [PATCH 25/27] kconfig: switch to ASSIGN_VAL state in the second lexer Date: Tue, 11 Dec 2018 20:01:08 +0900 Message-Id: <1544526070-16690-26-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1544526070-16690-1-git-send-email-yamada.masahiro@socionext.com> References: <1544526070-16690-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org To simplify the generated lexer, switch to the ASSIGN_VAL state in the hand-made lexer. Signed-off-by: Masahiro Yamada --- scripts/kconfig/zconf.l | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/scripts/kconfig/zconf.l b/scripts/kconfig/zconf.l index c8823a4..d462507 100644 --- a/scripts/kconfig/zconf.l +++ b/scripts/kconfig/zconf.l @@ -25,6 +25,7 @@ static struct { int lineno; } current_pos; +static int prev_prev_token = T_EOL; static int prev_token = T_EOL; static char *text; static int text_size, text_asize; @@ -124,9 +125,9 @@ n [A-Za-z0-9_-] return T_WORD; free(yylval.string); } - "=" { BEGIN(ASSIGN_VAL); return T_EQUAL; } - ":=" { BEGIN(ASSIGN_VAL); return T_COLON_EQUAL; } - "+=" { BEGIN(ASSIGN_VAL); return T_PLUS_EQUAL; } + "=" return T_EQUAL; + ":=" return T_COLON_EQUAL; + "+=" return T_PLUS_EQUAL; [[:blank:]]+ . warn_ignored_character(*yytext); \n { @@ -294,6 +295,11 @@ repeat: if ((prev_token == T_EOL || prev_token == T_HELPTEXT) && token == T_EOL) goto repeat; + if (prev_prev_token == T_EOL && prev_token == T_WORD && + (token == T_EQUAL || token == T_COLON_EQUAL || token == T_PLUS_EQUAL)) + BEGIN(ASSIGN_VAL); + + prev_prev_token = prev_token; prev_token = token; return token; -- 2.7.4