[gnome-code-assistance] [backends/c] Check flags for multiple possible targets
- From: Jesse van den Kieboom <jessevdk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-code-assistance] [backends/c] Check flags for multiple possible targets
- Date: Tue, 12 Nov 2013 12:40:57 +0000 (UTC)
commit debb256bb3ea58901d0e5e0619bad5c5c2ae5800
Author: Jesse van den Kieboom <jessevdk gmail com>
Date: Tue Nov 12 13:40:20 2013 +0100
[backends/c] Check flags for multiple possible targets
backends/c/makefileintegration.py | 17 +++++++----------
1 files changed, 7 insertions(+), 10 deletions(-)
---
diff --git a/backends/c/makefileintegration.py b/backends/c/makefileintegration.py
index 4a7f584..d211c2d 100644
--- a/backends/c/makefileintegration.py
+++ b/backends/c/makefileintegration.py
@@ -277,18 +277,15 @@ class MakefileIntegration:
except:
return []
- try:
- pos = outstr.rindex(fakecc)
- except ValueError:
- return []
+ regfind = re.compile(fakecc + '([^\n]*)$', re.M)
- try:
- epos = outstr.index(os.linesep, pos)
- except ValueError:
- epos = len(outstr)
+ for m in regfind.finditer(outstr):
+ flags = self._filter_flags(makefile, shlex.split(m.group(1)))
+
+ if len(flags) != 0:
+ return flags
- pargs = outstr[pos + len(fakecc):epos]
- return self._filter_flags(makefile, shlex.split(pargs))
+ return []
def _filter_flags(self, makefile, flags):
# Keep only interesting flags:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]