From patchwork Tue Dec 11 11:01:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 153428 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp475400ljp; Tue, 11 Dec 2018 03:02:27 -0800 (PST) X-Google-Smtp-Source: AFSGD/Wn+sSjE+NvbF515PdR3Tl/0jLmgqos/gevngZkLXXLF4H/UdYRTmnRm3TtZy3n2ADTICBh X-Received: by 2002:a63:2315:: with SMTP id j21mr14370873pgj.297.1544526147333; Tue, 11 Dec 2018 03:02:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544526147; cv=none; d=google.com; s=arc-20160816; b=H3ftYfyXGGG/lYacXQsnvlcbvLktSTvCICBZJEgkG6AP6agxOxbpQLk2NBA8mUqL+1 FqkKfkC312PcwtLLL3WZOb4bYTbWeXvkENxK8dPbXEYOBJ1RyWzhB0NzIxC4IwwqDIW7 2Cofbx5ctosDag0y7LfDaA/bBTAsw2wG7uFthi52QurcWmSGE1udZW0PotrneDDvv+hJ fw2yyCy47D5ABYq2Mvg12kIGXQYwrQhK7fCTPQuzZ+GTisvg/N1bCFw7C/2bQFhbVo4E JijDGMG74n/oo2ze4wxQCX/SvEV+PmXINPgB5zn/O5N8GtHQkOg+fqbRMhPTzIkfvi/7 Bj/A== 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 d66si12890969pfg.36.2018.12.11.03.02.27; Tue, 11 Dec 2018 03:02:27 -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 S1726812AbeLKLCZ (ORCPT + 31 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(-) -- 2.7.4 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;