Commit 3513626d authored by Pierre Rossi's avatar Pierre Rossi
Browse files

Support commenting out the Q_OBJECT macro

We shouldn't try to run moc on such files...
parent 96e116f3
No related merge requests found
Showing with 15 additions and 0 deletions
......@@ -4,7 +4,22 @@ import re, sys, os
mocables = set()
for f in filter(os.path.isfile, sys.argv[1:]):
inBlockComment = False
for line in open(f).readlines():
# Block comments handling
if "/*" in line:
inBlockComment = True
if inBlockComment and "*/" in line:
inBlockComment = False
if line.find("*/") != len(line) - 3:
line = line[line.find("*/")+2:]
else:
continue
if inBlockComment:
continue
#simple comments handling
if "//" in line:
line = line.partition("//")[0]
if re.match(".*Q_OBJECT", line):
mocables.add(f)
for mocable in mocables:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment