Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Kconfig parser #2553

Merged
merged 5 commits into from
May 26, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions main/parsers_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
JavaPropertiesParser, \
JavaScriptParser, \
JsonParser, \
KconfigParser, \
LdScriptParser, \
LispParser, \
LuaParser, \
Expand Down
32 changes: 32 additions & 0 deletions parsers/kconfig.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/* This module contains functions for generating tags for the Kconfig language
masatake marked this conversation as resolved.
Show resolved Hide resolved
* (https://www.kernel.org/doc/html/latest/kbuild/kconfig-language.html).
*/

/*
* INCLUDE FILES
*/
#include "general.h" /* always include first */
#include "parse.h" /* always include */
#include "routines.h"
#include "selectors.h"

static tagRegexTable kconfigTagRegexTable [] = {
{"^\\s*(menu)?config\\s+([A-Za-z0-9_]+)\\s*$", "\\2",
"c,config,configs", NULL},
};

/*
* FUNCTION DEFINITIONS
*/

extern parserDefinition* KconfigParser (void)
{
static const char *const patterns [] = { "Kconfig*", NULL };

parserDefinition* const def = parserNew ("Kconfig");
def->patterns = patterns;
def->tagRegexTable = kconfigTagRegexTable;
def->tagRegexCount = ARRAY_SIZE (kconfigTagRegexTable);
def->method = METHOD_NOT_CRAFTED|METHOD_REGEX;
return def;
}
1 change: 1 addition & 0 deletions source.mak
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ PARSER_SRCS = \
parsers/jprop.c \
parsers/jscript.c \
parsers/json.c \
parsers/kconfig.c \
parsers/ldscript.c \
parsers/lisp.c \
parsers/lua.c \
Expand Down
1 change: 1 addition & 0 deletions win32/ctags_vs2013.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@
<ClCompile Include="..\parsers\jprop.c" />
<ClCompile Include="..\parsers\jscript.c" />
<ClCompile Include="..\parsers\json.c" />
<ClCompile Include="..\parsers\kconfig.c" />
<ClCompile Include="..\parsers\ldscript.c" />
<ClCompile Include="..\parsers\lisp.c" />
<ClCompile Include="..\parsers\lua.c" />
Expand Down
3 changes: 3 additions & 0 deletions win32/ctags_vs2013.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,9 @@
<ClCompile Include="..\parsers\json.c">
<Filter>Source Files\Parsers</Filter>
</ClCompile>
<ClCompile Include="..\parsers\kconfig.c">
<Filter>Source Files\Parsers</Filter>
</ClCompile>
<ClCompile Include="..\parsers\ldscript.c">
<Filter>Source Files\Parsers</Filter>
</ClCompile>
Expand Down