Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2145401imm; Mon, 28 May 2018 02:32:39 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqhBbZBAt4CCIP+/aAKLon6pjVGLHNEyD8Br7SppYA31s7II35ZCNKssWiLh84NvMwM771M X-Received: by 2002:a62:a21e:: with SMTP id m30-v6mr12849852pff.251.1527499959893; Mon, 28 May 2018 02:32:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527499959; cv=none; d=google.com; s=arc-20160816; b=SwOqzDEB+rtDN1h6Kvb2PVnk8bt3LoqDSSkHLOEqe0wMWCNEivruAJDJh2t8EBNO+j 94jjlnRW3ytZQkEo//H1athVcj6hxHHh7VRKW9Og+M10DBF7RnVAiNjI2jhObluUW+NJ VJ7ZEGultBEMwh2cijs+dCoYgbi4IjrxN/hzTagTb6QiNTyV6fWu5JJnrOjqfMjmIY+X pGw/422X/wOWM0IYBQQwqt4VdvV7p246OqMc5Mjx/jA+zRRmYsao0JUP0p00u1clEt1n KjkPanZ07on1XTF9PhWnKSLxxoj4mwwL8x7I7wQXQFQBk7UD+x6+ePclPBj7Zt2ZJkCP ez/w== 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 :arc-authentication-results; bh=vAy22p2EOlKxrkyyKFQXW4coGIYwZi29YzZ3Dr91Q+Q=; b=Jg3WpPu0gWILdMYuCq/yF2i6zbnp6t2GtbZwSVHhZ1htyZcaWhrJgHT90Q8e5GX9fk rqJEE3CSpMG3XEJGbfGvEEjfWdV76pvCWSLs9lkSupawpHumTzypkaRxCob0xnPxe4Tz vW03ez7WTnM4Osuh5kfVI3bfO86BfwUl2sXq4SNxzg1ylGXoRlzlErwc/fZfmIGh5zLH uUB5R09F2CIEp9Z7m/FWKJqeH8q4F1OhjHB4OEz3fDlWcwqyX9sGWKWovYj8xj6QWEFY vifYAKekdl+iD4lsGag8NvJGGeGBqCa+Slssnws4osrkSdX7Sgl+G5NfqvbfuUoY+HYn UXgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=Q4hCNZdb; 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 s13-v6si29187208plp.350.2018.05.28.02.32.25; Mon, 28 May 2018 02:32:39 -0700 (PDT) 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=Q4hCNZdb; 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 S1754444AbeE1J3q (ORCPT + 99 others); Mon, 28 May 2018 05:29:46 -0400 Received: from conuserg-10.nifty.com ([210.131.2.77]:21618 "EHLO conuserg-10.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754324AbeE1JYQ (ORCPT ); Mon, 28 May 2018 05:24:16 -0400 Received: from grover.sesame (FL1-125-199-20-195.osk.mesh.ad.jp [125.199.20.195]) (authenticated) by conuserg-10.nifty.com with ESMTP id w4S9MInS027506; Mon, 28 May 2018 18:22:28 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com w4S9MInS027506 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1527499348; bh=vAy22p2EOlKxrkyyKFQXW4coGIYwZi29YzZ3Dr91Q+Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Q4hCNZdbjYXxw5MXA3isYTJHKQrSyXuwKKlVGP/zKM/RrxsWnQ6IVU02m9CNx1Q4R kxwA4cFPL8fG87OqA8ieubgGC+77LPyN+v5fgNTIZl858kg1gYJ10KivDJ5bz1qg8d hRrGFT/s3xCooZcr1buySwtfm7bV/ctPcMjGFIotsRfSP/wS9Dy4CNj/Q9tYmw0NxV n9LDxAgUSl3Wry4BtPWOqoHYVCr0xjgvNzXXTJRQl2b6RTKKd0CRPApdj4DKN7XiP1 FCdmC8VKe4Rp14LRKTiLWea7DHcQ5b6K9r8G0OZtTr987qcqvS/w/EkBP1u9KBcC3N QKpR4e9MaXjIA== X-Nifty-SrcIP: [125.199.20.195] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Kees Cook , Nicholas Piggin , "Luis R . Rodriguez" , Randy Dunlap , Ulf Magnusson , Sam Ravnborg , Linus Torvalds , Masahiro Yamada Subject: [PATCH v5 11/31] kconfig: begin PARAM state only when seeing a command keyword Date: Mon, 28 May 2018 18:21:48 +0900 Message-Id: <1527499328-13213-12-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1527499328-13213-1-git-send-email-yamada.masahiro@socionext.com> References: <1527499328-13213-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 Currently, any statement line starts with a keyword with TF_COMMAND flag. So, the following three lines are dead code. alloc_string(yytext, yyleng); zconflval.string = text; return T_WORD; If a T_WORD token is returned in this context, it will cause syntax error in the parser anyway. The next commit will support the assignment statement where a line starts with an arbitrary identifier. So, I want the lexer to switch to the PARAM state only when it sees a command keyword. Signed-off-by: Masahiro Yamada --- Changes in v5: None Changes in v4: None Changes in v3: - Newly added Changes in v2: None scripts/kconfig/zconf.l | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/kconfig/zconf.l b/scripts/kconfig/zconf.l index b385590..9a14797 100644 --- a/scripts/kconfig/zconf.l +++ b/scripts/kconfig/zconf.l @@ -102,10 +102,10 @@ n [A-Za-z0-9_-] { {n}+ { const struct kconf_id *id = kconf_id_lookup(yytext, yyleng); - BEGIN(PARAM); current_pos.file = current_file; current_pos.lineno = yylineno; if (id && id->flags & TF_COMMAND) { + BEGIN(PARAM); yylval.id = id; return id->token; } -- 2.7.4