Commits

Michał Górny committed 9c2a59e

Drop whitespace surrounding removed flags in Token.data.

Comments (0)

Files changed (1)

lib/flaggie/makeconf.py

 			@property
 			def data(self):
 				if self.modified:
-					return ''.join([f.toString(True) for f in self.flags])
+					hadremovedflag = False
+					ret = ''
+					for f in self.flags:
+						if isinstance(f, MakeConfVariable.FlattenedToken.MakeConfFlag) and \
+								f.removed:
+							hadremovedflag = True
+						else:
+							if not isinstance(f, MakeConfVariable.FlattenedToken.Whitespace) or \
+									not hadremovedflag:
+								ret += f.toString(True)
+							hadremovedflag = False
+
+					return ret
 				else:
 					return self.s