'Extract a unique set of KumaScript macro names used in the content'

@newrelic.agent.function_trace()
def macro_names(self):

    names = set()
    try:
        txt = []
        for token in parse(self.document.html).stream:
            if (token['type'] in ('Characters', 'SpaceCharacters')):
                txt.append(token['data'])
        txt = ''.join(txt)
        names.update(MACRO_RE.findall(txt))
    except:
        pass
    return list(names)
