lkml.org 
[lkml]   [2018]   [May]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v5 11/31] kconfig: begin PARAM state only when seeing a command keyword
    Date
    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 <yamada.masahiro@socionext.com>
    ---

    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_-]
    <COMMAND>{
    {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
    \
     
     \ /
      Last update: 2018-05-28 11:30    [W:2.379 / U:0.304 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site