mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
#2706 - Local privates to search_privates.py
This commit is contained in:
parent
1242cc8349
commit
d091fcbdbc
@ -16,7 +16,7 @@ def get_private_declare(content):
|
||||
|
||||
priv_dec_str = ''.join(priv_srch_declared)
|
||||
|
||||
srch = re.compile('(?<![_a-zA-Z0-9])(_[a-zA-Z]*?)[ ,\}\]\)";]')
|
||||
srch = re.compile('(?<![_a-zA-Z0-9])(_[a-zA-Z0-9]*?)[ ,\}\]\)";]')
|
||||
priv_split = srch.findall(priv_dec_str)
|
||||
priv_split = sorted(set(priv_split))
|
||||
priv_declared += priv_split;
|
||||
@ -27,12 +27,18 @@ def get_private_declare(content):
|
||||
|
||||
priv_dec_str = ''.join(priv_srch_declared)
|
||||
|
||||
srch = re.compile('(?<![_a-zA-Z0-9])(_[a-zA-Z]*?)[ ,\}\]\)";]')
|
||||
srch = re.compile('(?<![_a-zA-Z0-9])(_[a-zA-Z0-9]*?)[ ,\}\]\)";]')
|
||||
priv_split = srch.findall(priv_dec_str)
|
||||
priv_split = sorted(set(priv_split))
|
||||
|
||||
priv_declared += priv_split;
|
||||
|
||||
srch = re.compile('(?i)[\s]*local[\s]+(_[\w\d]*)[\s]*=.*')
|
||||
priv_local = srch.findall(content)
|
||||
priv_local_declared = sorted(set(priv_local))
|
||||
|
||||
priv_declared += priv_local_declared;
|
||||
|
||||
|
||||
return priv_declared
|
||||
|
||||
@ -53,7 +59,7 @@ def check_privates(filepath):
|
||||
|
||||
|
||||
# Regex search privates
|
||||
srch = re.compile('(?<![_a-zA-Z0-9])(_[a-zA-Z]*?)[ ,\^\-\+\/\*\%\}\]\)";]')
|
||||
srch = re.compile('(?<![_a-zA-Z0-9])(_[a-zA-Z0-9]*?)[ =,\^\-\+\/\*\%\}\]\)";]')
|
||||
priv_use = srch.findall(content)
|
||||
priv_use = sorted(set(priv_use))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user