List of Changes in the Pyparsing Parser
Although we tried to keep the esp-idf-kconfig package as close to the original kconfiglib as possible, there are some differences between the two. This section describes those differences. For the original definition of the Kconfig language, please refer to the Kconfig language documentation.
optionkeyword is deprecated and supported only in the form ofoption env=.def_<type>keywords are not supported.tristatelogic (and thusmvalue) is not supported.optionalkeyword forchoiceentries is not supported.choiceentries are now forced to be abooltype.---help---keyword is not supported.configorchoicenames must contain only numbers, uppercase letters from the English alphabet and underscores.Multiple definitions of
config/choiceentries are now reported to the user.The inference of default values has been reworked (see Default Values and Their Inference).
Preprocessor macros are supported only in the form of
symbol = valueorsymbol := valueand strings need to be enclosed in quotes.New parser recognizes default values in
sdkconfigfiles (see Default Values and Their Inference).
When parser v2 fails and parser v1 accepts the same tree, kconfgen checks the error location (the reported line and the adjacent lines) for the unsupported constructs above.
If one is found, the failure is reported as intended: please fix the Kconfig.
If none is found, the failure is reported as a possible parser bug.
If both parsers reject the tree, the original v2 error is kept.
KCONFIG_PARSER_VERSION=1 is a temporary workaround only when parser v1 still accepts the tree.
Deprecated Constructs
Important
Do not use the following constructs in your Kconfig files. They will become errors in a future major release.
The following constructs are still accepted, because the original kconfiglib accepts them as well, but the parser v2 reports them as deprecated. They will become errors in a future major release.
Help text that is not indented deeper than the
helpkeyword. The Kconfig language is indentation based, but the originalkconfiglibdoes not enforce indentation, which makes the end of a help block ambiguous for the reader. Indent the help text one level deeper than thehelpkeyword.The
booleantype keyword. Useboolinstead.A
configdefined without an explicit type. Give the symbol a type (bool,string,int,hex, orfloat).An unquoted default on a string symbol that is not an all-uppercase name of an existing symbol. Quote the string, e.g.
default "host.example.com"instead ofdefault host.example.com.A quoted
choicename, e.g.choice "Connection Method". Such a name is not a valid identifier. The choice is treated as unnamed. You can either omit the choice identifier completely (preferred) or use an identifier consisting of only numbers, uppercase letters from the English alphabet and underscores.A
configorchoicename that contains lowercase letters. Lowercase names are not valid identifiers. Please use an identifier consisting of only numbers, uppercase letters from the English alphabet and underscores.