-
Notifications
You must be signed in to change notification settings - Fork 153
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 a list of tokens that are always indexed #288
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,7 @@ | |
from threading import Thread, Lock, Event, Condition | ||
|
||
import lib | ||
from lib import script, scriptLines | ||
from lib import script, scriptLines, always_indexed_tokens | ||
import data | ||
from data import PathList | ||
from find_compatible_dts import FindCompatibleDTS | ||
|
@@ -315,11 +315,12 @@ def update_references(self, idxes): | |
if even: | ||
tok = prefix + tok | ||
|
||
if (db.defs.exists(tok) and | ||
not ( (idx*idx_key_mod + line_num) in defs_idxes and | ||
defs_idxes[idx*idx_key_mod + line_num] == tok ) and | ||
(family != 'M' or tok.startswith(b'CONFIG_'))): | ||
# We only index CONFIG_??? in makefiles | ||
ref_allowed = db.defs.exists(tok) or (tok in always_indexed_tokens) | ||
# We only index CONFIG_??? in makefiles | ||
config_or_not_makefile = tok.startswith(b'CONFIG_') or family != 'M' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any reason to reverse the conditional order from There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IIRC I called the variable config_or_not_makefile and decided to reverse order to make it match the name. Assuming that expression will be evaluated left to right, old order is probably a bit better, I will fix that. |
||
i = idx*idx_key_mod + line_num | ||
|
||
if ref_allowed and defs_idxes.get(i) != tok and config_or_not_makefile: | ||
if tok in idents: | ||
idents[tok] += ',' + str(line_num) | ||
else: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe use
lib.always_indexed_tokens
instead and avoid a manual import.