mirror of
https://github.com/Sei-Lisa/LSL-PyOptimizer
synced 2025-07-01 23:58:20 +00:00
Add comment on the validity of the RE for detecting certain defines.
This commit is contained in:
parent
5ad68906e9
commit
6b45d4efcf
1 changed files with 7 additions and 0 deletions
7
main.py
7
main.py
|
@ -502,6 +502,13 @@ def main():
|
|||
return status
|
||||
del p, status
|
||||
|
||||
# This method is very imperfect, in several senses. However, since
|
||||
# it's applied to the output of the preprocessor, all of the concerns
|
||||
# should be addressed:
|
||||
# - \s includes \n, but \n should not be allowed.
|
||||
# - Comments preceding the directive should not cause problems.
|
||||
# e.g.: /* test */ #directive
|
||||
# - #directive within a comment or string should be ignored.
|
||||
for x in re.findall(r'(?:(?<=\n)|^)\s*#\s*define\s+('
|
||||
r'USE_SWITCHES'
|
||||
r'|USE_LAZY_LISTS'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue