File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,15 @@ class Expander:
1818
1919 include_guard = re .compile ('#.*ATCODER_[A-Z_]*_HPP' )
2020
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+
2130 def __init__ (self , lib_paths : List [Path ]):
2231 self .lib_paths = lib_paths
2332
@@ -45,14 +54,16 @@ def expand_acl(self, acl_name: str) -> List[str]:
4554
4655 result = [] # type: List[str]
4756 for line in acl_source .splitlines ():
48- if self .include_guard . match (line ):
57+ if self .is_ignored_line (line ):
4958 continue
5059
5160 m = self .atcoder_include .match (line )
5261 if m :
5362 result .extend (self .expand_acl (m .group (1 )))
5463 continue
64+
5565 result .append (line )
66+
5667 return result
5768
5869 def expand (self , source : str ) -> str :
You can’t perform that action at this time.
0 commit comments