From patchwork Tue Dec 11 11:01:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 10723599 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 485B114E2 for ; Tue, 11 Dec 2018 11:02:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 38BA42A171 for ; Tue, 11 Dec 2018 11:02:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2D3802A194; Tue, 11 Dec 2018 11:02:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 115122A171 for ; Tue, 11 Dec 2018 11:02:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726692AbeLKLBo (ORCPT ); Tue, 11 Dec 2018 06:01:44 -0500 Received: from conuserg-11.nifty.com ([210.131.2.78]:36706 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726600AbeLKLBo (ORCPT ); Tue, 11 Dec 2018 06:01:44 -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 wBBB1C5u017210; Tue, 11 Dec 2018 20:01:26 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com wBBB1C5u017210 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1544526086; bh=uqOZ9vU8oru+M9Os9BjewQ7I6t7aJJ1laipYhaaZlRQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FGgwOUfpfex79hXVFIznqJ03YWykn1b5Ie9Yi7W13S0/MfuZ1/YHOzE/Wbxe+HDzM 9Ep+/KcvTASYBlSVrBC8ckfZ4v+uMExEEDPvsbXMPJ53WTzdz0YRTanuw/G5uSnW7z sqIwAPsAtm/FM6cfiVDhTiqG7i4wLujFQqWP52UTw5+tXT3jjxqDlZ3eW+DEkfv3iN 8gDRC/GMz2uOf/epdif4n72wXaub6rL5YnXHuuDPWhYWxuoFTzORk+6ZpFv+UNu9jv eqcbEtq9LdTVUI6ak537rINB8ySXaI7QGjQW2U4tfPyU0wcrlKu0LR1pUsNHWeSXck r7fYiUownkBAA== 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 19/27] kconfig: use T_WORD instead of T_VARIABLE for variables Date: Tue, 11 Dec 2018 20:01:02 +0900 Message-Id: <1544526070-16690-20-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-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP There is no grammatical ambiguity by using T_WORD for variables. The parser can distinguish variables from symbols from the context. Signed-off-by: Masahiro Yamada --- scripts/kconfig/zconf.l | 4 ++-- scripts/kconfig/zconf.y | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/kconfig/zconf.l b/scripts/kconfig/zconf.l index 981b5f8..defb722 100644 --- a/scripts/kconfig/zconf.l +++ b/scripts/kconfig/zconf.l @@ -116,13 +116,13 @@ n [A-Za-z0-9_-] } alloc_string(yytext, yyleng); yylval.string = text; - return T_VARIABLE; + return T_WORD; } ({n}|$)+ { /* this token includes at least one '$' */ yylval.string = expand_token(yytext, yyleng); if (strlen(yylval.string)) - return T_VARIABLE; + return T_WORD; free(yylval.string); } "=" { BEGIN(ASSIGN_VAL); return T_EQUAL; } diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y index 97f86e2..3c44d67 100644 --- a/scripts/kconfig/zconf.y +++ b/scripts/kconfig/zconf.y @@ -84,7 +84,6 @@ static struct menu *current_menu, *current_entry; %token T_STRING %token T_TRISTATE %token T_EOL -%token T_VARIABLE %token T_ASSIGN_VAL %left T_OR @@ -480,7 +479,7 @@ word_opt: /* empty */ { $$ = NULL; } /* assignment statement */ -assignment_stmt: T_VARIABLE assign_op assign_val T_EOL { variable_add($1, $3, $2); free($1); free($3); } +assignment_stmt: T_WORD assign_op assign_val T_EOL { variable_add($1, $3, $2); free($1); free($3); } assign_op: T_EQUAL { $$ = VAR_RECURSIVE; }