@@ -0,0 +1,1085 @@
+%22%22%22Build src/py_ast.js from the documentation of Python ast module.%22%22%22%0A%0Aimport os%0Aimport re%0Aimport json%0A%0Aimport urllib.request%0A%0Aast_url = %22https://raw.githubusercontent.com/python/cpython/main/Doc/library/ast.rst%22%0Af = urllib.request.urlopen(ast_url)%0A%0Aclasses = %7B%7D%0A%0Adef add_class(line):%0A   line = line%5Blen(starter):%5D.strip()%0A   ix = line.find('(')%0A   if ix %3E -1:%0A       name = line%5B:ix%5D%0A       args = line%5Bix:%5D%5B1:-1%5D%0A   else:%0A       name, args = line, ''%0A   classes%5Bname%5D = args%0A%0Akl = False%0Astarter = '.. class:: '%0Afor line in f:%0A    line = line.decode('utf-8')%0A    if line.startswith(starter):%0A        add_class(line)%0A        kl = True%0A    elif kl and line.startswith(' ' * len(starter)):%0A        add_class(line)%0A    else:%0A        kl = False%0A%0Akeys = sorted(list(classes))%0Alines = %5B%5D%0Afor key in keys:%0A    lines.append(f%22%7Bkey%7D:'%7Bclasses%5Bkey%5D%7D'%22.replace(' ', ''))%0A%0Adest_dir = os.path.join(os.path.dirname(os.getcwd()), %22www%22, %22src%22)%0Awith open(os.path.join(dest_dir, 'py_ast.js'), 'w', encoding='utf-8') as out:%0A    out.write('__BRYTHON__.ast_classes = %7B%5Cn' + ',%5Cn'.join(lines) + '%5Cn%7D%5Cn')%0A

Add script to generate src/py_ast.js (classes for Python Abstract Syntax Tree)