From: Carl Woffenden Date: Wed, 19 Jan 2022 16:48:10 +0000 (+0100) Subject: Suggestion from code review X-Git-Tag: v1.5.4^2~267^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=786263ea85c9325fc03eca3a8d78bfe1c7a19547;p=thirdparty%2Fzstd.git Suggestion from code review --- diff --git a/build/single_file_libs/combine.py b/build/single_file_libs/combine.py index 125e7d427..55cf32c5e 100755 --- a/build/single_file_libs/combine.py +++ b/build/single_file_libs/combine.py @@ -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: