Within ifdefs we still need to honor line continuations.
authorBenjamin Smedberg <benjamin@smedbergs.us>
Wed, 11 Feb 2009 11:44:13 -0500
changeset 93 c6223e135ac6
parent 92 7950a2d51eda
child 94 24687637a4a8
push id50
push userbsmedberg@mozilla.com
push dateWed, 11 Feb 2009 19:52:29 +0000
Within ifdefs we still need to honor line continuations.
pymake/parser.py
tests/ifdefs.mk
--- a/pymake/parser.py
+++ b/pymake/parser.py
@@ -550,16 +550,18 @@ def parsestream(fd, filename, makefile):
 
             if kword in conditionkeywords:
                 m = conditionkeywords[kword](d, offset, makefile)
                 condstack.append(Condition(m, d.getloc(offset)))
                 continue
 
             if any((not c.active for c in condstack)):
                 log.info('%s: skipping line because of active conditions' % (d.getloc(0),))
+                for c in itermakefilechars(d, offset):
+                    pass
                 continue
 
             if kword == 'endef':
                 raise SyntaxError("Unmatched endef", d.getloc(offset))
 
             if kword == 'define':
                 e, t, i = parsemakesyntax(d, offset, (), itermakefilechars)
 
--- a/tests/ifdefs.mk
+++ b/tests/ifdefs.mk
@@ -35,16 +35,28 @@ BAZ3FOUND = false
 ifdef FOO3
 FOO3FOUND = true
 else ifdef BAR3
 BAR3FOUND = true
 else
 BAZ3FOUND = true
 endif
 
+ifdef RANDOM
+CONTINUATION = \
+else           \
+endif
+endif
+
+TESTSET =
+
+ifdef TESTSET
+$(error TESTSET was not set)
+endif
+
 TESTEMPTY = $(NULL)
 ifndef TESTEMPTY
 $(error TEST-FAIL TESTEMPTY was probably expanded!)
 endif
 
 all:
 	test $(FOOFOUND) = true   # FOOFOUND
 	test $(BARFOUND) = false  # BARFOUND