Bug 604279: Handle spacing in front of define and endef when inside a define block. r=ted a=NPOTB

This commit is contained in:
Kyle Huey 2010-10-14 17:04:26 -04:00
parent a5a776d55d
commit ec0f0943fa
2 changed files with 12 additions and 2 deletions

View File

@ -233,7 +233,7 @@ def itercommandchars(d, offset, tokenlist, it):
yield s[offset:d.lend].replace('\n\t', '\n'), None, None, None
_redefines = re.compile('define|endef')
_redefines = re.compile('\s*define|\s*endef')
def iterdefinelines(it, startloc):
"""
Process the insides of a define. Most characters are included literally. Escaped newlines are treated
@ -246,7 +246,7 @@ def iterdefinelines(it, startloc):
for d in it:
m = _redefines.match(d.s, d.lstart, d.lend)
if m is not None:
directive = m.group(0)
directive = m.group(0).strip()
if directive == 'endef':
definecount -= 1
if definecount == 0:

View File

@ -50,6 +50,16 @@ value \
endef
endef
# Test ridiculous spacing
define TEST10
define TEST11
baz
endef
define TEST12
foo
endef
endef
all:
$(COMMANDS)
$(COMMANDS2)