Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp512357imu; Tue, 11 Dec 2018 03:05:13 -0800 (PST) X-Google-Smtp-Source: AFSGD/VrH5KFWVt1Izt2FMVXwOtoEcGVs+wbhdLy1/WugbtpEIuFj7gKdLt/Kiwx//jGXVqJ1paT X-Received: by 2002:a62:8dd9:: with SMTP id p86mr15682326pfk.143.1544526313102; Tue, 11 Dec 2018 03:05:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544526313; cv=none; d=google.com; s=arc-20160816; b=AfcQibiNLyqX2hGUjJqS4d2hgKlAtuN2iCz+0FxHllxG3Hs5Ts1frbh2qvO7w/3VQM E6u1UJPgfElWQbKYmEuyHHKZzR1RvVMjK153H/JQiKBU5S7smVN2NIIsov9I6wGIxVNG 7ULh33/ULDe+Pt193++x0LhWf+2w/xJAvj8vFEZz825K0CtQnuZvH0gIRPnqZ4rLJX1H ANsct8x5ghNHt1cxgrQeQfuRtKupPuk4Iu6HVF4DOC2S50nD8IV9Ym3+76D4iNM94J7U BY2SC/Qyz7LjYoLd3Dcss+zqBvAQaP1kzqHcQqIBSlG+YbKzHwE9k00Oc3f7dgOml0TN vvmA== 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=uqOZ9vU8oru+M9Os9BjewQ7I6t7aJJ1laipYhaaZlRQ=; b=OScoqkC4mTlYeWw2NsP5OgWcqECn28V6tTxuSAToafXWcthmin0CGiq9ZI5NbqF8c+ 2uHmQVeae7nFMDFOdkoJ5m0YSiFQdyxEJczDL1eXlhptHjcyLDHB0aabZp2N8qqEXVEp xc1bKXtxh43kGCp65khgBEi/sWZtYcsOfZCnMCrdsVzXWtWOetryTvb/R19PzwsfrkPZ XqzxX8acmj6G/7INRXZD93MTeFjjBzMD17GVd1+c8rYmxAWOwo5CaQWLu7G+GsJJicwQ n/kZ4S1SiD/qvP11PTmsX1OZxKQ5oLu732KDPA4qzirs2jJTAt4K47Kf/dpIevbQdD5b Y31A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=FGgwOUfp; 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 p26si13109734pfj.244.2018.12.11.03.04.58; Tue, 11 Dec 2018 03:05:13 -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=FGgwOUfp; 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 S1726737AbeLKLBv (ORCPT + 99 others); Tue, 11 Dec 2018 06:01:51 -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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; } -- 2.7.4