{"id":4427,"date":"2022-03-17T18:10:25","date_gmt":"2022-03-17T10:10:25","guid":{"rendered":"http:\/\/blog.coolcoding.cn\/?p=4427"},"modified":"2022-03-17T18:11:05","modified_gmt":"2022-03-17T10:11:05","slug":"python%e7%89%88%e6%9c%ac%e7%9a%84lua-parse","status":"publish","type":"post","link":"https:\/\/blog.coolcoding.cn\/?p=4427","title":{"rendered":"python\u7248\u672c\u7684lua-parse"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code>\u5b89\u88c5\npip install luaparse\n\n\u4f7f\u7528\nfrom luaparser import ast\nfrom luaparser import astnodes\ntxt = open(\"d:\\\\1.lua\", \"r\").read()\ntree = ast.parse(txt)\nprint(ast.to_pretty_str(tree))\n\n\u4ee3\u7801\u5730\u5740\uff1ahttps:\/\/github.com\/boolangery\/py-lua-parser\n\n\u53e6\u6709\u4e00\u4e2aLua\u7248\u672c\uff1ahttps:\/\/github.com\/davidm\/lua-fish<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts\/4427"}],"collection":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4427"}],"version-history":[{"count":2,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts\/4427\/revisions"}],"predecessor-version":[{"id":4429,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts\/4427\/revisions\/4429"}],"wp:attachment":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4427"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4427"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4427"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}