Lines Matching full:is
8 Kconfiglib is a Python 2/3 library for scripting and extracting information
18 For the Linux kernel, a handy interface is provided by the
34 If you do not wish to install Kconfiglib via pip, the Makefile patch is set up
40 Warning: The directory name Kconfiglib/ is significant in this case, because
51 been preloaded and is available in 'kconf'. To change the Python interpreter
52 used, pass PYTHONCMD=<executable> to make. The default is "python".
58 The item contained in a menu node is found in MenuNode.item (note that this can
121 Symbol.set_value()), but this user value is only respected if the symbol is
125 For symbols with prompts, the visibility of the symbol is determined by the
127 a user value on them is pointless. A warning will be printed by default if
128 Symbol.set_value() is called on a promptless symbol. Assignments to promptless
163 FOO to be visible (assignable). If its value is m, the symbol can only be
169 'default' properties are used if the symbol is not visible or has no user
177 value of the symbol. The lower bound is determined by the value of the
181 For non-bool/tristate symbols, it only matters whether the visibility is n or
185 condition is n, the 'default' or 'select' is disabled. If it is m, the
186 'default' or 'select' value (the value of the selecting symbol) is truncated
195 For a visible bool/tristate symbol FOO with value n, this line is written to
198 # CONFIG_FOO is not set
200 The point is to remember the user n selection (which might differ from the
203 above a comment). When the .config file is read back in, this line will be
210 sym.visibility is non-0 (non-n) to see whether the user value will have an
217 The menu structure, as seen in e.g. menuconfig, is represented by a tree of
219 top-level menu, the title of which is shown at the top in the standard
220 menuconfig interface. (The title is also available in Kconfig.mainmenu_text in
223 The top node is found in Kconfig.top_node. From there, you can visit child menu
229 MenuNode.item is either a Symbol or a Choice object, or one of the constants
243 The prompt is a (text, condition) tuple, where condition determines the
246 This organization mirrors the C implementation. MenuNode is called
249 It is possible to give a Choice a name and define it in multiple locations,
250 hence why Choice.nodes is also a list.
253 available on the MenuNode itself, in e.g. MenuNode.defaults. This is helpful
267 A, B, C, ... are symbols (Symbol instances), NOT is the kconfiglib.NOT
298 - The value of A && B is min(A.tri_value, B.tri_value)
300 - The value of A || B is max(A.tri_value, B.tri_value)
302 - The value of !A is 2 - A.tri_value
304 - The value of A = B is 2 (y) if A.str_value == B.str_value, and 0 (n)
305 otherwise. Note that str_value is used here instead of tri_value.
314 Kconfig.const_syms is a dictionary like Kconfig.syms but for constant symbols.
316 If a condition is missing (e.g., <cond> when the 'if <cond>' is removed from
317 'default A if <cond>'), it is actually Kconfig.y. The standard __str__()
331 statement, instead of relative to the project root. This extension is not
359 If an absolute path is given to 'rsource', it acts the same as 'source'.
381 pattern to match no files: 'osource' and 'orsource' (the o is for "optional").
425 Represents a Kconfig configuration, e.g. for x86 or ARM. This is the set of
427 any number of Kconfig objects (including for different architectures) is
453 attribute is mostly maintained for backwards compatibility.
457 instance is kept for symbols defined in multiple locations. Kconfig order
458 is preserved otherwise.
470 is mostly maintained for backwards compatibility.
490 top-level Kconfig file. If a file is source'd multiple times, it will
493 Note: Using this for incremental builds is redundant. Kconfig.sync_deps()
502 will be registered. The older $FOO syntax is only supported for backwards
506 $FOO is actually set. If it isn't, $(FOO) is an expansion of an unset
509 Another gotcha is that environment variables referenced in the values of
511 only be registered if the variable is actually used (expanded) somewhere.
520 MODULES, which is backwards compatible. Kconfiglib will warn if
521 'option modules' is set on some other symbol. Tell me if you need proper
524 'modules' is never None. If the MODULES symbol is not explicitly defined,
527 A simple way to enable modules is to do 'kconf.modules.set_value(2)'
528 (provided the MODULES symbol is defined and visible). Modules are
538 The filename given by the defconfig_list symbol. This is taken from the
540 exists (can be opened for reading). If a defconfig file foo/defconfig is
542 $srctree/foo/defconfig is looked up as well.
544 'defconfig_filename' is None if either no defconfig_list symbol exists,
571 warnings still get added to Kconfig.warnings when 'warn_to_stderr' is
586 are not found in the current directory. This is used to support
591 the value when the configuration is loaded matters. This avoids surprises
596 loaded. This is the prefix used (and expected) on symbol names in .config
600 Like for srctree, only the value of $CONFIG_ when the configuration is
661 If the environment variable KCONFIG_STRICT is set to "y", warnings will
663 files. The reason this isn't the default is that some projects (e.g.
678 the right Kconfig is included from there (arch/$SRCARCH/Kconfig as of
681 If $srctree is set, 'filename' will be looked up relative to it.
682 $srctree is also used to look up source'd files within Kconfig files.
692 is provided as a constructor argument since warnings might be
728 _re_match(r"# {}([^ ]+) is not set".format(self.config_prefix))
786 # This is used to determine whether previously unseen symbols should be
905 "# CONFIG_FOO is not set" within a .config file sets the user value of
922 # is normal and expected within a .config file.
938 # later. This avoids invalidating everything and is faster.
939 # Another benefit is that invalidation must be rock solid for
974 if not ((sym.orig_type is BOOL and
976 (sym.orig_type is TRISTATE and
978 self._warn("'{}' is not a valid value for the {} "
993 if prev_mode is not None and \
1003 elif sym.orig_type is STRING:
1094 # Note: _write_to_conf is determined when the value is
1095 # calculated. This is a hidden function call due to
1105 elif sym.orig_type is STRING:
1111 if sym.orig_type is HEX and \
1131 single assignment is written out corresponding to the first location
1132 where the symbol is defined.
1162 ((item is MENU and expr_value(node.visibility)) or
1163 item is COMMENT):
1174 The resulting configuration file is incomplete, but a complete
1204 # choice, unless the choice is optional or the symbol type
1209 sym.choice._get_selection_from_defaults() is sym and \
1210 sym.orig_type is BOOL and \
1219 doing a full rebuild whenever the configuration is changed, mirroring
1222 This function is intended to be called during each build, before
1230 1. If the directory <path> does not exist, it is created.
1235 autoconf.h compared to before), the change is signaled by
1238 The first time sync_deps() is run on a directory, <path>/auto.conf
1243 The path to a symbol's file is calculated from the symbol's name
1248 This scheme matches the C tools. The point is to avoid having a
1252 3. A new auto.conf with the current symbol values is written, to keep
1256 The last piece of the puzzle is knowing what symbols each source file
1260 (provided sync_deps() is run first during each build).
1263 files is scripts/basic/fixdep.c. Missing symbol files also correspond
1288 # Note: _write_to_conf is determined when the value is
1289 # calculated. This is a hidden function call due to
1297 if sym._old_val is None and \
1308 elif sym._old_val is None:
1310 # _write_to_conf is false), and it wouldn't have appeared in
1336 # '# CONFIG_FOO is not set' comments). The format matches the C
1337 # implementation, though the ordering is arbitrary there (depends on
1340 # A separate helper function is neater than complicating write_config()
1354 # symbol values and restoring them later, but this is simpler and
1376 if sym.orig_type is STRING:
1387 tree. The iteration is done in Kconfig definition order (the children
1388 of a node are visited before the next node is visited).
1390 The Kconfig.top_node menu node is skipped. It contains an implicit menu
1448 The expression parsing is consistent with how parsing works for
1450 the C implementation. m is rewritten to 'm && MODULES', so
1453 # The parser is optimized to be fast when parsing Kconfig files (where
1542 Returns a string with information about the Kconfig object when it is
1548 "srctree is current directory" if not self.srctree else
1578 # This will try opening the same file twice if $srctree is unset,
1583 # This is needed for Python 3, because e2 is deleted after
1612 # <include path> is immutable and holds a *tuple* of
1614 # statements in the parent Kconfig files. The current include path is
1617 # The point of this redundant setup is to allow Kconfig._include_path
1624 # _include_path is a tuple, so this rebinds the variable instead of
1668 # This also works as expected if _saved_line is "", indicating EOF:
1669 # "" is falsy, and readline() returns "" over and over at EOF.
1696 # registering it if it does not exist. If '_parsing_kconfigs' is False,
1737 # regexes and string operations where possible. This is the biggest
1752 # to the previous token. See _STRING_LEX for why this is needed.
1763 # If the first token is not a keyword (and not a weird help token),
1775 # Test for an identifier/keyword first. This is the most common
1784 # Check what it is. lookup_sym() will take care of allocating
1804 # following is accepted:
1818 # We always strip whitespace after tokens, so it is safe to
1819 # assume that s[i] is the start of a token here.
1825 # os.path.expandvars() and the $UNAME_RELEASE replace() is
1828 # undefined env. vars. as is.
1838 # This is the only place where we don't survive with a
1843 tokens[0] is _T_OPTION else \
1877 # isspace() is False for empty strings
1948 # See the 'Intro to expressions' section for what a constant symbol is.
1975 if self._tokens[self._tokens_i + 1] is not None:
1996 if self._tokens[self._tokens_i + 1] is not None:
2004 if self._peek_token() is not None:
2010 # If the next token is 'token', removes it and returns True
2012 if self._tokens[self._tokens_i + 1] is token:
2160 # $(1) is replaced by the first argument to the function, etc.,
2243 if e1 is self.y:
2246 if e2 is self.y:
2249 if e1 is self.n or e2 is self.n:
2257 if e1 is self.n:
2260 if e2 is self.n:
2263 if e1 is self.y or e2 is self.y:
2269 # Parses a block, which is the contents of either a file or an if,
2284 # 'prev' is reused to parse a list of child menu nodes (for a menu or
2285 # Choice): After parsing the children, the 'next' pointer is assigned
2288 # Returns the final menu node in the block (or 'prev' if the block is
2298 if t0 is None:
2309 node.is_menuconfig = (t0 is _T_MENUCONFIG)
2336 # Check if the pattern is absolute and avoid stripping srctree
2362 # Unless an absolute path is passed to *source, strip
2365 # MenuNode.filename, which is nice e.g. when generating
2374 elif t0 is end_token:
2380 elif t0 is _T_IF:
2394 elif t0 is _T_MENU:
2414 elif t0 is _T_COMMENT:
2432 elif t0 is _T_CHOICE:
2433 if self._peek_token() is None:
2470 elif t0 is _T_MAINMENU:
2488 # <expr>, or self.y if the next token is not _T_IF
2501 # property is added when a symbol or choice is defined in multiple
2515 if t0 is None:
2520 if self._peek_token() is not None:
2523 elif t0 is _T_DEPENDS:
2530 elif t0 is _T_HELP:
2533 elif t0 is _T_SELECT:
2540 elif t0 is _T_IMPLY:
2547 elif t0 is _T_DEFAULT:
2557 elif t0 is _T_PROMPT:
2560 elif t0 is _T_RANGE:
2565 elif t0 is _T_OPTION:
2579 "but the environment variable {0} is not "
2604 # To reduce warning spam, only warn if 'option modules' is
2609 if node.item is not self.modules:
2610 self._warn("the 'modules' option is not supported. "
2611 "Let me know if this is a problem for you, "
2622 self._parse_error("the 'allnoconfig_y' option is only "
2630 elif t0 is _T_VISIBLE:
2637 elif t0 is _T_OPTIONAL:
2639 self._parse_error('"optional" is only valid for choices')
2671 # '*prompt *' is invalid
2679 if node.help is not None:
2684 # Small optimization. This code is pretty hot.
2702 # If the first non-empty lines has zero indent, there is no help
2756 # (no &&). Parsing code is always a bit tricky.
2762 # version, but is wasteful for short expressions and complicates
2768 # which is bad.
2800 # '... if <expr>', etc.), m is rewritten to m && MODULES.
2801 if transform_m and token is self.m:
2812 if token is _T_NOT:
2816 if token is _T_OPEN_PAREN:
2831 # of the dependent items. This is used for caching/invalidation.
2862 # The direct dependencies. This is usually redundant, as the direct
2870 # they're in, but that's handled automatically since the Choice is
2935 # The menu node is a choice, menu, or if. Finalize each child in
2938 if node.item is MENU:
2971 if cur is not node:
3091 if self._filename is None:
3110 # universal newlines on both Python 2 and 3 (and is an alias for
3141 # - sym.nodes empty means the symbol is undefined (has no
3165 if filename is not None:
3196 "is set incorrectly. Note that the current value of $srctree " \
3197 "is saved when the Kconfig instance is created (for " \
3222 UNKNOWN is for undefined symbols, (non-special) constant symbols, and
3238 This is the symbol value that's used in relational expressions
3250 This is the symbol value that's used outside of relation expressions
3258 values is calculated from the symbol's visibility and selects/implies.
3262 (1,), and (2,). A (1,) or (2,) result means the symbol is visible but
3266 For string/hex/int symbols, check if Symbol.visibility is non-0 (non-n)
3271 # Is 'sym' an assignable (visible) bool/tristate symbol?
3315 symbols. Doubles as a flag for whether a symbol is a choice symbol.
3319 example, 'default A && B if C || D' is represented as
3320 ((AND, A, B), (OR, C, D)). If no condition was given, 'cond' is
3328 example, 'select A if B && C' is represented as (A, (AND, B, C)). If no
3329 condition was given, 'cond' is self.kconfig.y.
3339 example, 'range 1 2 if A' is represented as (1, 2, A). If there is no
3340 condition, 'cond' is self.config.y.
3351 Multiple selections get ORed together. A condition on a select is ANDed
3361 The 'depends on' dependencies. If a symbol is defined in multiple
3364 Internally, this is used to implement 'imply', which only applies if the
3381 'option env="FOO"' acts like a 'default' property whose value is the
3394 True if the symbol is a constant (quoted) symbol.
3397 The Kconfig instance this symbol is from.
3436 if self.orig_type is TRISTATE and \
3448 if self._cached_str_val is not None:
3457 # string value. This is why things like "FOO = bar" work for seeing if
3459 if self.orig_type is UNKNOWN:
3464 # Warning: See Symbol._rec_invalidate(), and note that this is a hidden
3478 # Check if a range is in effect
3494 # Defaults are used if the symbol is invisible, lacks a user value,
3510 # If the user value is well-formed and satisfies range
3511 # contraints, it is stored in exactly the same form as
3545 if clamp is not None:
3546 # The value is rewritten to a standard form if it is
3549 if self.orig_type is INT else \
3561 elif self.orig_type is STRING:
3562 if vis and self.user_value is not None:
3563 # If the symbol is visible and has a user value, use that
3573 # env_var corresponds to SYMBOL_AUTO in the C implementation, and is
3577 # incorrectly. This code is pretty cold anyway.
3578 if self.env_var is not None or self is self.kconfig.defconfig_list:
3589 if self._cached_tri_val is not None:
3593 if self.orig_type is not UNKNOWN:
3596 "The {} symbol {} is being evaluated in a logical context "
3603 # Warning: See Symbol._rec_invalidate(), and note that this is a hidden
3613 if vis and self.user_value is not None:
3614 # If the symbol is visible and has a user value, use that
3645 # m is promoted to y for (1) bool symbols and (2) symbols with a
3648 (self.type is BOOL or expr_value(self.weak_rev_dep) == 2):
3655 val = 2 if self.choice.selection is self else 0
3669 if self._cached_assignable is None:
3679 if self._cached_vis is None:
3689 # Note: _write_to_conf is determined when the value is calculated. This
3690 # is a hidden function call due to property magic.
3699 "# {}{} is not set\n" \
3706 if self.orig_type is STRING:
3725 Choice.user_selection is considered when the choice is in y mode (the
3742 Returns True if the value is valid for the type of the symbol, and
3747 visibility is non-n.
3752 # This optimization is skipped for choice symbols: Setting a choice
3760 # Check if the value is valid for our type
3761 if not (self.orig_type is BOOL and value in (0, 2, "n", "y") or
3762 self.orig_type is TRISTATE and value in (0, 1, 2, "n", "m", "y") or
3764 (self.orig_type is STRING or
3765 self.orig_type is INT and _is_base_n(value, 10) or
3766 self.orig_type is HEX and _is_base_n(value, 16)
3771 "the value {} is invalid for {}, which has type {} -- "
3787 # choice. Like for symbol user values, the user selection is not
3803 if self.user_value is not None:
3821 value, visibility, and location(s)) when it is evaluated on e.g. the
3842 if self.user_value is not None:
3857 if self is self.kconfig.defconfig_list:
3858 fields.append("is the defconfig_list symbol")
3860 if self.env_var is not None:
3863 if self is self.kconfig.modules:
3864 fields.append("is the modules symbol")
3882 Returns a string representation of the symbol when it is printed,
3885 The string is constructed by joining the strings returned by
3890 An empty string is returned for undefined and constant symbols.
3934 # _write_to_conf is calculated along with the value. If True, the
3954 # Warning: See Symbol._rec_invalidate(), and note that this is a hidden
3968 if self.type is BOOL or expr_value(self.weak_rev_dep) == 2:
3977 if self.type is BOOL or expr_value(self.weak_rev_dep) == 2:
4004 if self is self.kconfig.modules:
4015 # If item._cached_vis is None, it means there can't be cached
4026 # This gracefully handles dependency loops too, which is nice
4029 if item._cached_vis is not None:
4038 # if set_value() is called on them, which would cause them to lose
4075 # Transpose mod to yes if type is bool (possibly due to modules
4077 if val == 1 and self.type is BOOL:
4092 # and menus) is selected by some other symbol. Also warn if a symbol
4093 # whose direct dependencies evaluate to m is selected to y.
4095 msg = "{} has direct dependencies {} with value {}, but is " \
4149 The type of the choice. One of BOOL, TRISTATE, UNKNOWN. UNKNOWN is for
4166 0 (n) - The choice is disabled and no symbols can be selected. For
4167 visible choices, this mode is only possible for choices with
4175 Only tristate choices can be in m mode. The visibility of the choice is
4176 an upper bound on the mode, and the mode in turn is an upper bound on the
4183 special-casing in many code paths. This is why there is a lot of
4184 similarity to Symbol. The value (mode) of a choice is really just a
4187 dependency is 'm && <visibility>').
4207 is not in y mode or has no selected symbol (due to unsatisfied
4223 choice is not in y mode, but still remembered so that the choice "snaps
4224 back" to the user selection if the mode is changed back to y. This might
4234 that an implicit menu is created, it won't be a choice symbol, and won't
4241 always contain a single MenuNode, but it is possible to give a choice a
4247 example, 'default A if B && C' is represented as (A, (AND, B, C)). If
4248 there is no condition, 'cond' is self.config.y.
4267 The Kconfig instance this choice is from.
4298 if self.orig_type is TRISTATE and not self.kconfig.modules.tri_value:
4316 # non-optional choices, which is how the C implementation does it
4320 if self.user_value is not None:
4323 # Warning: See Symbol._rec_invalidate(), and note that this is a hidden
4328 return 2 if val == 1 and self.type is BOOL else val
4335 if self._cached_assignable is None:
4345 if self._cached_vis is None:
4355 if self._cached_selection is _NO_CACHED_SELECTION:
4364 attribute (is_optional) can never be in n mode, but 0/"n" is still
4368 Returns True if the value is valid for the type of the choice, and
4379 if not ((self.orig_type is BOOL and value in (0, 2, "n", "y") ) or
4380 (self.orig_type is TRISTATE and value in (0, 1, 2, "n", "m", "y"))):
4384 "the value {} is invalid for {}, which has type {} -- "
4407 if self.user_value is not None or self.user_selection:
4424 Returns a string with information about the choice when it is evaluated
4438 if self.user_value is not None:
4448 if self.selection is not self.user_selection:
4465 Returns a string representation of the choice when it is printed,
4507 # is_constant is checked by _make_depend_on(). Just set it to avoid
4520 # Warning: See Symbol._rec_invalidate(), and note that this is a hidden
4529 return (2,) if self.type is BOOL else (1, 2)
4530 return (0, 2) if self.type is BOOL else (0, 1, 2)
4539 # Warning: See Symbol._rec_invalidate(), and note that this is a hidden
4577 if item._cached_vis is not None:
4584 and comments also get menu nodes. If a symbol or choice is defined in
4587 The top-level menu node, corresponding to the implicit top-level menu, is
4604 The following menu node. None if there is no following node.
4614 The parent menu node. None if there is no parent.
4618 conditional expression (which is self.kconfig.y if there is no
4619 condition). None if there is no prompt.
4621 For symbols and choices, the prompt is stored in the MenuNode rather than
4631 multiple definition locations/menu nodes). MenuNode.defaults is meant for
4644 The help text for the menu node for Symbols and Choices. None if there is
4646 It is possible to have a separate help text at each location if a symbol
4647 is defined in multiple locations.
4652 attribute, and this attribute is then in turn propagated to the
4655 If a symbol or choice is defined in multiple locations, only the
4674 separate menu. This is the case for the following items:
4684 'is_menuconfig' is just a hint on how to display the menu node. It's
4688 The location where the menu node appears. The filename is relative to
4695 was included. The first element is the location of the 'source' statement
4702 The Kconfig instance the menu node is from.
4728 # only applies to these, in case a symbol is defined in multiple
4740 # self.dep is included to catch dependencies from a lone 'depends on'
4747 if self.item is MENU:
4771 Returns a string with information about the menu node when it is
4781 if self.item.name is not None:
4785 elif self.item is MENU:
4788 elif self.item is COMMENT:
4791 elif self.item is None:
4804 fields.append("is menuconfig")
4808 if self.item is MENU:
4812 if isinstance(self.item, (Symbol, Choice)) and self.help is not None:
4851 s = '{} "{}"\n'.format("menu" if self.item is MENU else "comment",
4854 if self.dep is not self.kconfig.y:
4857 if self.item is MENU and self.visibility is not self.kconfig.y:
4870 if cond is not self.kconfig.y:
4883 if sc.orig_type is not UNKNOWN:
4895 if sc is sc.kconfig.defconfig_list:
4898 if sc.env_var is not None:
4901 if sc is sc.kconfig.modules:
4924 if self.dep is not sc.kconfig.y:
4927 if self.help is not None:
4952 True if the variable is recursive (defined with =).
5000 if expr[0] is AND:
5006 if expr[0] is OR:
5011 if expr[0] is NOT:
5022 if op1.orig_type is STRING and op2.orig_type is STRING:
5034 if oper is EQUAL: res = comp == 0
5035 elif oper is UNEQUAL: res = comp != 0
5036 elif oper is LESS: res = comp < 0
5037 elif oper is LESS_EQUAL: res = comp <= 0
5038 elif oper is GREATER: res = comp > 0
5039 elif oper is GREATER_EQUAL: res = comp >= 0
5067 This function is called for every symbol/choice (hence "sc") appearing in
5068 the expression, with the symbol/choice as the argument. It is expected to
5080 if expr[0] is AND:
5084 if expr[0] is OR:
5085 # This turns A && B || C && D into "(A && B) || (C && D)", which is
5090 if expr[0] is NOT:
5117 if subexpr[0] is not NOT:
5151 # Second || is not at the top level
5162 if isinstance(subexpr, tuple) and subexpr[0] is op:
5173 Escapes the string 's' in the same fashion as is done for display in
5185 Unescapes the string 's'. \ followed by any character is replaced with just
5197 usage note to stderr if more than one command-line argument is passed.
5207 .config file to load/save) if it is set, and ".config" otherwise.
5219 # Symbol or Choice 'sc' -- the logic is nearly identical.
5228 if sc.choice.orig_type is TRISTATE and \
5229 sc.orig_type is not TRISTATE and sc.choice.tri_value != 2:
5233 if sc.orig_type is TRISTATE and vis == 1 and sc.choice.tri_value == 2:
5239 if vis == 1 and sc.type is not TRISTATE:
5255 if expr[0] is not NOT:
5265 if isinstance(expr, tuple) and expr[0] is type_:
5279 # and set.add() returning None, which is falsy.
5339 # to debug otherwise. 'e' is the UnicodeDecodeError object.
5341 # If the decoding error is for the output of a $(shell,...) command,
5345 if macro_linenr is None:
5383 return expr is sym
5391 if right is sym:
5393 elif left is not sym:
5396 return (expr[0] is EQUAL and right is sym.kconfig.m or \
5397 right is sym.kconfig.y) or \
5398 (expr[0] is UNEQUAL and right is sym.kconfig.n)
5400 return expr[0] is AND and \
5420 # named choice is defined in multiple locations to add on symbols). It
5448 while first and first.item is None:
5453 if cur.next and cur.next.item is None:
5473 # If no type is specified for the choice, its type is that of
5475 if choice.orig_type is UNKNOWN:
5477 if item.orig_type is not UNKNOWN:
5483 if sym.orig_type is UNKNOWN:
5488 # (which is calculated earlier in Kconfig._build_dep()).
5494 # 2. When a symbol/choice is first visited, _visited is set to 1, meaning
5499 # there's a dependency loop. The loop is found on the call stack by
5500 # recording symbols while returning ("on the way back") until X is seen
5505 # _visited is set to 2, meaning "visited, not part of a dependency
5512 # choice symbol in a sense. When a choice is "entered" via a choice symbol
5545 # The symbol is not part of a dependency loop
5552 # The symbol was checked earlier and is already known to not be part of
5570 if sym is not skip:
5572 # "is a choice symbol" path by passing True
5578 # The choice is not part of a dependency loop
5585 # The choice was checked earlier and is already known to not be part of
5596 # Is the symbol/choice 'cur' where the loop started?
5597 if cur is not loop[0]:
5607 if item is not loop[0]:
5629 if item.rev_dep is not item.kconfig.n:
5633 if item.weak_rev_dep is not item.kconfig.n:
5652 sym.kconfig._warn("{} selects the {} symbol {}, which is not "
5660 sym.kconfig._warn("{} implies the {} symbol {}, which is not "
5675 if sym.orig_type is STRING:
5707 "the {} symbol {} has ranges, but is not int or hex"
5723 # Returns True if the (possibly constant) symbol 'sym' is valid as a value
5731 return sym.orig_type is type_
5755 if default.choice is not choice:
5756 choice.kconfig._warn("the default selection {} of {} is not "
5766 if sym.rev_dep is not sym.kconfig.n:
5769 if sym.weak_rev_dep is not sym.kconfig.n:
5773 if node.parent.item is choice:
5779 sym.kconfig._warn("the choice symbol {} is defined with a "
5784 msg = "the choice symbol {} is {} by the following symbols, which has " \
5896 # The token and type constants below are safe to test with 'is', which is a bit
5906 # pickling (where 'is' would be a bad idea anyway) and no small-integer
6029 # Tokens after which strings are expected. This is used to tell strings from
6034 # these tokens. _T_CHOICE is included to avoid symbols being registered for
6080 # there is only one token).
6084 # '$' is included to detect a variable assignment left-hand side with a $ in it
6125 # Constant representing that there's no cached choice selection. This is
6127 # will do) for it so we can test with 'is'.
6130 # Used in comparisons. 0 means the base is inferred from the format of the
6161 Kconfig.__init__() is looked up relative to $srctree (which is set to '{}')