File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,14 @@ class Expander:
17
17
'#include\s*["<](atcoder/[a-z_]*(|.hpp))[">]\s*' )
18
18
19
19
include_guard = re .compile ('#.*ATCODER_[A-Z_]*_HPP' )
20
+ def is_ignored_line (self , line ) -> bool :
21
+ if self .include_guard .match (line ):
22
+ return True
23
+ if line .strip () == "#pragma once" :
24
+ return True
25
+ if line .strip ().startswith ('//' ):
26
+ return True
27
+ return False
20
28
21
29
def __init__ (self , lib_paths : List [Path ]):
22
30
self .lib_paths = lib_paths
@@ -45,14 +53,16 @@ def expand_acl(self, acl_name: str) -> List[str]:
45
53
46
54
result = [] # type: List[str]
47
55
for line in acl_source .splitlines ():
48
- if self .include_guard . match (line ):
56
+ if self .is_ignored_line (line ):
49
57
continue
50
-
58
+
51
59
m = self .atcoder_include .match (line )
52
60
if m :
53
61
result .extend (self .expand_acl (m .group (1 )))
54
62
continue
63
+
55
64
result .append (line )
65
+
56
66
return result
57
67
58
68
def expand (self , source : str ) -> str :
You can’t perform that action at this time.
0 commit comments