@@ -0,0 +1,949 @@
+%22%22%22Transforms python.gram into python.gram.js_actions where grammar actions%0Asyntax is adapted to Javascript%0A%22%22%22%0A%0Aimport re%0A%0Awith open('python.gram', encoding='utf-8') as f:%0A    src = f.read()%0A%0Asep = re.search(%22%5E'''%22, src, flags=re.M).start()%0Ahead = src%5B:sep%5D%0Asrc = src%5Bsep:%5D%0A%0Aaction_re = re.compile(r%22(?%3C!')%5C%7B(.*?)%5C%7D%22, flags=re.S)%0Anew_src = ''%0Apos = 0%0Afor mo in action_re.finditer(src):%0A    new_src += src%5Bpos:mo.start()%5D%0A    pos = mo.end()%0A    action = src%5Bmo.start():mo.end()%5D%0A    action1 = re.sub(r'-%3Ev%5C..*?%5C.', '.', action)%0A    action2 = re.sub(r'%5C(%5C(.*_ty%5C) (.*?)%5C)', r'%5C1', action1)%0A    action3 = re.sub(r'%5C(%5B%5E(%5D+ %5C*%5C)', '', action2)%0A    action4 = re.sub(r'%5C(%5Ba-z_%5D*%5C*?%5C)_Py', '_Py', action3)%0A    action5 = re.sub(r'(%5Ba-z_%5D+)%5C*', r'%5C1', action4)%0A    action6 = re.sub('-%3E', '.', action5)%0A    new_src += action6%0A%0Anew_src += src%5Bpos:%5D%0A%0Awith open('python.gram.js_actions', 'w', encoding='utf-8') as out:%0A    out.write(head + new_src)%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A

Add a script scripts/transform_grammar_actions.py that adapts grammar actions in python.gram to Javascript syntax