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