mirror of
https://github.com/facebook/zstd.git
synced 2025-08-08 17:22:10 +03:00
Suggestion from code review
This commit is contained in:
@@ -41,6 +41,18 @@ destn: TextIO = sys.stdout
|
|||||||
# Set of file Path objects previously inlined (and to ignore if reencountering).
|
# Set of file Path objects previously inlined (and to ignore if reencountering).
|
||||||
found: Set[Path] = set()
|
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:
|
# Compiled regex Patern to handle the following type of file includes:
|
||||||
#
|
#
|
||||||
# #include "file"
|
# #include "file"
|
||||||
@@ -80,18 +92,6 @@ def test_match_include() -> bool:
|
|||||||
return True
|
return True
|
||||||
return False
|
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.
|
# Simple tests to prove pragma_regex's cases.
|
||||||
#
|
#
|
||||||
def text_match_pragma() -> bool:
|
def text_match_pragma() -> bool:
|
||||||
|
Reference in New Issue
Block a user