Improve comment handling and macro name recognition in macroscope.

This commit is contained in:
Eric S. Raymond 2007-04-06 07:44:12 +00:00
parent 35bf230d16
commit 7a7b0ca40b

View file

@ -75,9 +75,11 @@ class macro_cross_reference:
formals = line.split()[2:]
elif line.startswith("#enddef"):
formals = []
if line[0] == "#" or "{" not in line:
if '#' in line:
line = line.split('#')[0]
if not line or "{" not in line:
continue
for match in re.finditer(r"\{([A-Z][A-Z0-9_:]*[A-Z0-9])\b", line):
for match in re.finditer(r"\{([A-Z][A-Z0-9_:]*[A-Z0-9_])\b", line):
name = match.group(1)
if name in formals:
continue