{"id":397409,"date":"2021-03-23T23:51:24","date_gmt":"2021-03-23T15:51:24","guid":{"rendered":"http:\/\/4563.org\/?p=397409"},"modified":"2021-03-23T23:51:24","modified_gmt":"2021-03-23T15:51:24","slug":"%e6%83%b3%e8%a6%81%e5%81%9a%e4%b8%80%e4%b8%aa-node-js-%e7%9a%84-string-based-%e7%9a%84%e6%a8%a1%e6%9d%bf%e5%bc%95%e6%93%8e%e9%9c%80%e8%a6%81%e5%ad%a6%e4%bb%80%e4%b9%88","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=397409","title":{"rendered":"\u60f3\u8981\u505a\u4e00\u4e2a Node.js \u7684 String-Based \u7684\u6a21\u677f\u5f15\u64ce\u9700\u8981\u5b66\u4ec0\u4e48"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u60f3\u8981\u505a\u4e00\u4e2a Node.js \u7684 String-Based \u7684\u6a21\u677f\u5f15\u64ce\u9700\u8981\u5b66\u4ec0\u4e48               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : YouMoeYi <\/span>  <span><i><\/i> 1<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u56e0\u4e3a\u4e0d\u6ee1 Node \u73b0\u6709\u7684\u6a21\u677f\u5f15\u64ce\u5e93\uff0c\u6240\u4ee5\u60f3\u81ea\u5df1\u505a\u4e00\u4e2a\uff08\u5916\u52a0\u953b\u70bc\u81ea\u5df1\uff09 <\/p>\n<p>\u6211\u4e86\u89e3\u5230 String-Based \u7684\u6a21\u677f\u5f15\u64ce\u4e00\u822c\u6709\u4e24\u79cd\u5b9e\u73b0\u65b9\u5f0f <\/p>\n<ol>\n<li>\u76f4\u63a5\u5229\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\uff0c\u4f46\u662f\u6211\u60f3\u505a\u4e00\u4e2a\u6bd4\u8f83\u5b8c\u5584\u7684\u6a21\u677f\u5f15\u64ce\uff0c\u54a8\u8be2\u67d0\u5927\u4f6c\u5f97\u77e5\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u4e0d\u9002\u5408\u5b9e\u73b0\u7a0d\u590d\u6742\u7684\u6a21\u677f\u5f15\u64ce <\/li>\n<li>\u7528 parser \u751f\u6210 AST\uff0c\u7136\u540e\u628a AST \u7f16\u8bd1\u6210 HTML \u5373 Template =parse=&gt; AST =compile=&gt; HTML <\/li>\n<\/ol>\n<p>\u4f46\u662f\u95ee\u9898\u6765\u4e86\uff0c\u6211\u5e94\u8be5\u5b66\u4e9b\u4ec0\u4e48\u624d\u80fd\u6709\u5b9e\u73b0\u8fd9\u4e2a\u7684\u80fd\u529b\uff0c\u6211\u9664\u4e86\u60f3\u5230\u5b66\u7f16\u8bd1\u539f\u7406\uff08\u6211\u6ca1\u5b66\u8fc7\uff09\uff0c\u5176\u4ed6\u7684\u6211\u5c31\u4e0d\u592a\u6e05\u695a\u4e86\uff0c\u5e0c\u671b\u5404\u4f4d dalao \u80fd\u7ed9\u70b9\u65b9\u5411\uff0c\u6700\u597d\u80fd\u5177\u4f53\u4e00\u70b9<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>4<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"5545646\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Acebiu <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5bf9\u4e8e\u7b2c\u4e00\u4e2a\uff0c500 lines \u91cc\u9762\u6b63\u597d\u6709\u4e00\u4e2a\u8fd9\u6837\u7684\u9879\u76ee https:\/\/github.com\/aosabook\/500lines\/tree\/master\/template-engine<br \/>\u5bf9\u4e8e\u7b2c\u4e8c\u4e2a\uff0chttps:\/\/github.com\/lark-parser\/lark\/blob\/master\/docs\/json_tutorial.md \u4e5f\u8bb8\u80fd\u5bf9\u4f60\u6709\u6240\u5e2e\u52a9\u3002\u6211\u53ea\u662f\u6b63\u597d\u7528\u8fc7\u8fd9\u4e2a\uff0c\u5bf9\u8fd9\u5757\u4e5f\u4e0d\u662f\u5f88\u4e86\u89e3\u5c31\u4e0d\u778e\u626f\u4e86 hhhh                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5545647\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : binux <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5148\u60f3\u6e05\u695a\u4f60\u8981\u4ec0\u4e48\u6837\u7684\u6a21\u677f\u5f15\u64ce\u518d\u8003\u8651\u600e\u4e48\u5b9e\u73b0<br \/>1,2 \u4e0d\u77db\u76fe\uff0c\u4f60\u4f9d\u7136\u53ef\u4ee5\u7528\u6b63\u5219\u505a tokenizer \u3002<br \/>\u4f60\u53ef\u4ee5\u770b\u4e0b\u8bed\u6cd5\u5206\u6790\uff0c\u6709\u8f6e\u5b50\u53ef\u4ee5\u7528\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5545648\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : YouMoeYi <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @binux OK \u611f\u8c22\u63d0\u4f9b\u65b9\u5411                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5545649\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : shyangs <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u597d\u5947\u4f60\u6709\u4ec0\u9ebc\u6709\u8da3\u7684\u9ede\u5b50. \u901f\u5ea6\u5feb, \u9ad4\u7a4d\u5c0f, \u529f\u80fd\u5168 \u597d\u50cf\u5404\u7dad\u5ea6\u90fd\u6709\u73fe\u6210\u7684\u6a21\u677f\u5f15\u64ce\u505a\u4e86.                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u60f3\u8981\u505a\u4e00\u4e2a Node.js \u7684 S&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/397409"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=397409"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/397409\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=397409"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=397409"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=397409"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}