summaryrefslogtreecommitdiffstats
path: root/tools/sort-headers.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/sort-headers.py')
-rwxr-xr-xtools/sort-headers.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/sort-headers.py b/tools/sort-headers.py
index 42a8be8..07c7f24 100755
--- a/tools/sort-headers.py
+++ b/tools/sort-headers.py
@@ -39,9 +39,9 @@ def YesNo(prompt):
def IncludeCompareKey(line):
"""Sorting comparator key used for comparing two #include lines.
- Returns the filename without the #include/#import prefix.
+ Returns the filename without the #include/#import/import prefix.
"""
- for prefix in ('#include ', '#import '):
+ for prefix in ('#include ', '#import ', 'import '):
if line.startswith(prefix):
line = line[len(prefix):]
break
@@ -67,8 +67,9 @@ def IncludeCompareKey(line):
def IsInclude(line):
- """Returns True if the line is an #include/#import line."""
- return line.startswith('#include ') or line.startswith('#import ')
+ """Returns True if the line is an #include/#import/import line."""
+ return any([line.startswith('#include '), line.startswith('#import '),
+ line.startswith('import ')])
def SortHeader(infile, outfile):