Check line ranges on local macros.

This commit is contained in:
Eric S. Raymond 2007-05-04 10:49:36 +00:00
parent b5765d123e
commit 8df27ff9e6

View file

@ -195,8 +195,7 @@ class CrossRef:
defn = self.fileref[defn]
if defn.undef != None:
# Local macros are only visible in the file where they were defined
# FIXME: we should check line spans here.
return defn.filename == fn
return defn.filename == fn and n >= defn.lineno and n <= defn.undef
elif defn.filename in self.filelist.forest[0]:
# Macros in the first subtree are visible everywhere.
return True
@ -316,6 +315,7 @@ class CrossRef:
# Find references to resource files
for match in re.finditer(CrossRef.file_reference, line):
name = match.group(0)
# Catches maps that look like macro names.
if name.endswith(".map") and name[0] == '{':
name = name[1:]
key = None