]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Suggestion from code review
authorCarl Woffenden <cwoffenden@gmail.com>
Wed, 19 Jan 2022 16:48:10 +0000 (17:48 +0100)
committerCarl Woffenden <cwoffenden@gmail.com>
Wed, 19 Jan 2022 16:48:10 +0000 (17:48 +0100)
build/single_file_libs/combine.py

index 125e7d427a8ad9cb5f4d5702e9b265b95f22f6ac..55cf32c5ea21947a0bf6ee379a9ef83036150ae3 100755 (executable)
@@ -41,6 +41,18 @@ destn: TextIO = sys.stdout
 # Set of file Path objects previously inlined (and to ignore if reencountering).
 found: Set[Path] = set()
 
+# Compiled regex Patern to handle "#pragma once" in various formats:
+# 
+#   #pragma once
+#     #pragma once
+#   #  pragma once
+#   #pragma   once
+#   #pragma once // comment
+# 
+# Ignoring commented versions, same as include_regex.
+# 
+pragma_regex: Pattern = re.compile(r'^\s*#\s*pragma\s*once\s*')
+
 # Compiled regex Patern to handle the following type of file includes:
 # 
 #   #include "file"
@@ -80,18 +92,6 @@ def test_match_include() -> bool:
                         return True
     return False
 
-# Compiled regex Patern to handle "#pragma once" in various formats:
-# 
-#   #pragma once
-#     #pragma once
-#   #  pragma once
-#   #pragma   once
-#   #pragma once // comment
-# 
-# Ignoring commented versions, same as include_regex.
-# 
-pragma_regex: Pattern = re.compile(r'^\s*#\s*pragma\s*once\s*')
-
 # Simple tests to prove pragma_regex's cases.
 # 
 def text_match_pragma() -> bool: