1 # This file is part of libFirm.
2 # Copyright (C) 2012 Karlsruhe Institute of Technology.
5 def format_arguments(string, voidwhenempty = False):
6 args = re.split('\s*\n\s*', string)
9 if len(args) > 0 and args[-1] == '':
11 if len(args) == 0 and voidwhenempty:
13 return ", ".join(args)
15 def filter_isnot(list, flag):
16 return filter(lambda x: not hasattr(x, flag), list)
18 def filter_hasnot(list, flag):
19 return filter(lambda x: flag not in x, list)
21 def filter_notset(list, flag):
22 return filter(lambda x: not getattr(x,flag), list)