| 10 | from cmark import CMark |
| 11 | |
| 12 | def get_entities(): |
| 13 | regex = r'^{\(unsigned char\*\)"([^"]+)", \{([^}]+)\}' |
| 14 | with open(os.path.join(os.path.dirname(__file__), '..', 'src', 'entities.inc')) as f: |
| 15 | code = f.read() |
| 16 | entities = [] |
| 17 | for entity, utf8 in re.findall(regex, code, re.MULTILINE): |
| 18 | utf8 = bytes(map(int, utf8.split(", ")[:-1])).decode('utf-8') |
| 19 | entities.append((entity, utf8)) |
| 20 | return entities |
| 21 | |
| 22 | parser = argparse.ArgumentParser(description='Run cmark tests.') |
| 23 | parser.add_argument('--program', dest='program', nargs='?', default=None, |