mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-17 08:01:12 +02:00
Update lilv, lv2, serd, sord, sratom, and add suil.
This commit is contained in:
@@ -21,7 +21,7 @@ re_mac=re.compile("^[a-zA-Z_]\w*")
|
||||
re_fun=re.compile('^[a-zA-Z_][a-zA-Z0-9_]*[(]')
|
||||
re_pragma_once=re.compile('^\s*once\s*',re.IGNORECASE)
|
||||
re_nl=re.compile('\\\\\r*\n',re.MULTILINE)
|
||||
re_cpp=re.compile(r"""(/\*[^*]*\*+([^/*][^*]*\*+)*/)|//[^\n]*|("(\\.|[^"\\])*"|'(\\.|[^'\\])*'|.[^/"'\\]*)""",re.MULTILINE)
|
||||
re_cpp=re.compile(r'//.*?$|/\*.*?\*/|\'(?:\\.|[^\\\'])*\'|"(?:\\.|[^\\"])*"',re.DOTALL|re.MULTILINE)
|
||||
trig_def=[('??'+a,b)for a,b in zip("=-/!'()<>",r'#~\|^[]{}')]
|
||||
chr_esc={'0':0,'a':7,'b':8,'t':9,'n':10,'f':11,'v':12,'r':13,'\\':92,"'":39}
|
||||
NUM='i'
|
||||
@@ -37,10 +37,10 @@ ignored='i'
|
||||
undefined='u'
|
||||
skipped='s'
|
||||
def repl(m):
|
||||
s=m.group(1)
|
||||
if s:
|
||||
s=m.group(0)
|
||||
if s.startswith('/'):
|
||||
return' '
|
||||
return m.group(3)or''
|
||||
return s
|
||||
def filter_comments(filename):
|
||||
code=Utils.readf(filename)
|
||||
if use_trigraphs:
|
||||
@@ -246,7 +246,7 @@ def reduce_tokens(lst,defs,ban=[]):
|
||||
if one_param:args.append(one_param)
|
||||
break
|
||||
elif v2==',':
|
||||
if not one_param:raise PreprocError("empty param in funcall %s"%p)
|
||||
if not one_param:raise PreprocError("empty param in funcall %s"%v)
|
||||
args.append(one_param)
|
||||
one_param=[]
|
||||
else:
|
||||
@@ -362,7 +362,10 @@ def extract_macro(txt):
|
||||
return(name,[params,t[i+1:]])
|
||||
else:
|
||||
(p,v)=t[0]
|
||||
return(v,[[],t[1:]])
|
||||
if len(t)>1:
|
||||
return(v,[[],t[1:]])
|
||||
else:
|
||||
return(v,[[],[('T','')]])
|
||||
re_include=re.compile('^\s*(<(?P<a>.*)>|"(?P<b>.*)")')
|
||||
def extract_include(txt,defs):
|
||||
m=re_include.search(txt)
|
||||
@@ -475,7 +478,7 @@ class c_parser(object):
|
||||
if found:
|
||||
break
|
||||
found=self.cached_find_resource(n,filename)
|
||||
if found:
|
||||
if found and not found in self.ban_includes:
|
||||
self.nodes.append(found)
|
||||
if filename[-4:]!='.moc':
|
||||
self.addlines(found)
|
||||
@@ -518,6 +521,7 @@ class c_parser(object):
|
||||
except AttributeError:
|
||||
bld.parse_cache={}
|
||||
self.parse_cache=bld.parse_cache
|
||||
self.current_file=node
|
||||
self.addlines(node)
|
||||
if env['DEFINES']:
|
||||
try:
|
||||
@@ -557,12 +561,11 @@ class c_parser(object):
|
||||
else:state[-1]=accepted
|
||||
elif token=='include'or token=='import':
|
||||
(kind,inc)=extract_include(line,self.defs)
|
||||
if inc in self.ban_includes:
|
||||
continue
|
||||
if token=='import':self.ban_includes.add(inc)
|
||||
if ve:debug('preproc: include found %s (%s) ',inc,kind)
|
||||
if kind=='"'or not strict_quotes:
|
||||
self.tryfind(inc)
|
||||
self.current_file=self.tryfind(inc)
|
||||
if token=='import':
|
||||
self.ban_includes.add(self.current_file)
|
||||
elif token=='elif':
|
||||
if state[-1]==accepted:
|
||||
state[-1]=skipped
|
||||
@@ -583,7 +586,7 @@ class c_parser(object):
|
||||
self.defs.__delitem__(m.group(0))
|
||||
elif token=='pragma':
|
||||
if re_pragma_once.match(line.lower()):
|
||||
self.ban_includes.add(self.curfile)
|
||||
self.ban_includes.add(self.current_file)
|
||||
except Exception ,e:
|
||||
if Logs.verbose:
|
||||
debug('preproc: line parsing failed (%s): %s %s',e,line,Utils.ex_stack())
|
||||
|
Reference in New Issue
Block a user