summaryrefslogtreecommitdiffstats
path: root/libc/kernel/tools/clean_header.py
diff options
context:
space:
mode:
Diffstat (limited to 'libc/kernel/tools/clean_header.py')
-rwxr-xr-xlibc/kernel/tools/clean_header.py17
1 files changed, 5 insertions, 12 deletions
diff --git a/libc/kernel/tools/clean_header.py b/libc/kernel/tools/clean_header.py
index 6601817..0e0ed76 100755
--- a/libc/kernel/tools/clean_header.py
+++ b/libc/kernel/tools/clean_header.py
@@ -60,12 +60,7 @@
# using them anyway.
#
#
-# 3. Whitespace cleanup:
-#
-# The final pass removes any comments and empty lines from the final headers.
-#
-#
-# 4. Add a standard disclaimer:
+# 3. Add a standard disclaimer:
#
# The message:
#
@@ -141,8 +136,9 @@ def cleanupFile(path, original_path):
# now, let's parse the file
#
- blocks = cpp.BlockParser().parseFile(path)
- if not blocks:
+ parser = cpp.BlockParser()
+ blocks = parser.parseFile(path)
+ if not parser.parsed:
sys.stderr.write( "error: can't parse '%s'" % path )
sys.exit(1)
@@ -157,9 +153,7 @@ def cleanupFile(path, original_path):
blocks.optimizeIf01()
blocks.removeVarsAndFuncs( statics )
blocks.replaceTokens( kernel_token_replacements )
- blocks.removeComments()
blocks.removeMacroDefines( kernel_ignored_macros )
- blocks.removeWhiteSpace()
out = StringOutput()
out.write( kernel_disclaimer )
@@ -199,8 +193,7 @@ if __name__ == "__main__":
if opt == '-u':
noUpdate = 0
elif opt == '-v':
- verbose = 1
- D_setlevel(1)
+ logging.basicConfig(level=logging.DEBUG)
elif opt == '-k':
kernel_original_path = arg
elif opt == '-d':