diff options
Diffstat (limited to 'third_party/waf/waflib/Tools/d_scan.py')
-rw-r--r-- | third_party/waf/waflib/Tools/d_scan.py | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/third_party/waf/waflib/Tools/d_scan.py b/third_party/waf/waflib/Tools/d_scan.py index f5cec7e6d98..4b9b148d381 100644 --- a/third_party/waf/waflib/Tools/d_scan.py +++ b/third_party/waf/waflib/Tools/d_scan.py @@ -4,7 +4,7 @@ #!/usr/bin/env python # encoding: utf-8 -# Thomas Nagy, 2016 (ita) +# Thomas Nagy, 2016-2018 (ita) """ Provide a scanner for finding dependencies on d files @@ -33,7 +33,8 @@ def filter_comments(filename): i += 1 while i < max: c = txt[i] - if c == delim: break + if c == delim: + break elif c == '\\': # skip the character following backslash i += 1 i += 1 @@ -42,7 +43,8 @@ def filter_comments(filename): elif c == '/': # try to replace a comment with whitespace buf.append(txt[begin:i]) i += 1 - if i == max: break + if i == max: + break c = txt[i] if c == '+': # eat nesting /+ +/ comment i += 1 @@ -56,7 +58,8 @@ def filter_comments(filename): c = None elif prev == '+' and c == '/': nesting -= 1 - if nesting == 0: break + if nesting == 0: + break c = None i += 1 elif c == '*': # eat /* */ comment @@ -65,7 +68,8 @@ def filter_comments(filename): while i < max: prev = c c = txt[i] - if prev == '*' and c == '/': break + if prev == '*' and c == '/': + break i += 1 elif c == '/': # eat // comment i += 1 @@ -192,7 +196,8 @@ class d_parser(object): names = self.get_strings(code) # obtain the import strings for x in names: # optimization - if x in self.allnames: continue + if x in self.allnames: + continue self.allnames.append(x) # for each name, see if it is like a node or not @@ -207,3 +212,4 @@ def scan(self): nodes = gruik.nodes names = gruik.names return (nodes, names) + |