{"id":10006610,"date":"2022-09-27T09:40:35","date_gmt":"2022-09-27T01:40:35","guid":{"rendered":"https:\/\/ityet.com\/?p=10006610"},"modified":"2022-09-27T09:40:35","modified_gmt":"2022-09-27T01:40:35","slug":"%e6%89%8b%e5%86%99%e7%bc%96%e7%a8%8b%e8%af%ad%e8%a8%80-%e9%80%92%e5%bd%92%e5%87%bd%e6%95%b0%e6%98%af%e5%a6%82%e4%bd%95%e5%ae%9e%e7%8e%b0%e7%9a%84%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/itmax.cn\/?p=10006610","title":{"rendered":"\u624b\u5199\u7f16\u7a0b\u8bed\u8a00-\u9012\u5f52\u51fd\u6570\u662f\u5982\u4f55\u5b9e\u73b0\u7684\uff1f"},"content":{"rendered":"<h2>\u524d\u8a00<\/h2>\n<p>\u672c\u7bc7\u6587\u7ae0\u4e3b\u8981\u662f\u8bb0\u5f55\u4e00\u4e0b\u5728 <a href=\"https:\/\/link.segmentfault.com\/?enc=ME2ZLzvXGh1QP1FPAHW51A%3D%3D.vBG4xNMMT0P%2FNQ8ZA%2FN1MmFE9EwdrIsOsraQURdZaE99TRoWsx5%2BybSITWciz7v%2B\" rel=\"nofollow\">GScript<\/a> \u4e2d\u5b9e\u73b0\u9012\u5f52\u8c03\u7528\u65f6\u6240\u9047\u5230\u7684\u5751\uff0c\u7c7b\u4f3c\u7684\u95ee\u9898\u5728\u4e2d\u6587\u4e92\u8054\u7f51\u4e0a\u6211\u51e0\u4e4e\u6ca1\u6709\u627e\u5230\u76f8\u5173\u7684\u5185\u5bb9\uff0c\u6240\u4ee5\u8fd8\u662f\u5f88\u6709\u5fc5\u8981\u8bb0\u5f55\u4e00\u4e0b\u3002<\/p>\n<p>\u5728\u5f00\u59cb\u4e4b\u524d\u8fd8\u662f\u7b80\u5355\u4ecb\u7ecd\u4e0b\u672c\u6b21\u66f4\u65b0\u7684 <code>GScript<\/code> v0.0.9 \u6240\u5305\u542b\u7684\u5185\u5bb9\uff1a<\/p>\n<ul>\n<li>\u652f\u6301\u53ef\u53d8\u53c2\u6570<\/li>\n<li>\u4f18\u5316 <code>append<\/code> \u51fd\u6570\u8bed\u4e49<\/li>\n<li>\u4f18\u5316\u7f16\u8bd1\u9519\u8bef\u4fe1\u606f<\/li>\n<li>\u6700\u540e\u4e00\u4e2a\u5c31\u662f\u652f\u6301\u9012\u5f52\u8c03\u7528<\/li>\n<\/ul>\n<hr>\n<p>\u5148\u770b\u7b2c\u4e00\u4e2a\u53ef\u53d8\u53c2\u6570\uff1a<\/p>\n<pre><code class=\"java\">\/\/formats according to a format specifier and writes to standard output.\nprintf(string format, any ...a){}\n\n\/\/formats according to a format specifier and returns the resulting string.\nstring sprintf(string format, any ...a){}<\/code><\/pre>\n<p>\u4ee5\u4e0a\u662f\u968f\u7740\u672c\u6b21\u66f4\u65b0\u65b0\u589e\u7684\u4e24\u4e2a\u6807\u51c6\u51fd\u6570\uff0c\u5747\u652f\u6301\u53ef\u53d8\u53c2\u6570\uff0c\u5176\u4e2d\u4f7f\u7528 <code>...<\/code> \u8868\u793a\u53ef\u53d8\u53c2\u6570\uff0c\u8c03\u7528\u65f6\u5982\u4e0b\uff1a<\/p>\n<pre><code class=\"js\">printf(&quot;hello %s &quot;,&quot;123&quot;);\nprintf(&quot;hello-%s-%s &quot;,&quot;123&quot;,&quot;abc&quot;);\nprintf(&quot;hello-%s-%d &quot;,&quot;123&quot;,123);\nstring format = &quot;this is %s &quot;;\nprintf(format, &quot;gscript&quot;);\n\nstring s = sprintf(&quot;nice to meet %s&quot;, &quot;you&quot;);\nassertEqual(s,&quot;nice to meet you&quot;);<\/code><\/pre>\n<p>\u4e0e\u5927\u90e8\u5206\u8bed\u8a00\u7c7b\u4f3c\uff0c\u53ef\u53d8\u53c2\u6570\u672c\u8d28\u4e0a\u5c31\u662f\u4e00\u4e2a\u6570\u7ec4\uff0c\u6240\u4ee5\u53ef\u4ee5\u62ff\u6765\u5faa\u73af\u904d\u5386\uff1a<\/p>\n<pre><code class=\"js\">int add(string s, int ...num){\n    println(s);\n    int sum = 0;\n    for(int i=0;i&lt;len(num);i++){\n        int v = num[i];\n        sum = sum+v;\n    }\n    return sum;\n}\nint x = add(&quot;abc&quot;, 1,2,3,4);\nprintln(x);\nassertEqual(x, 10);<\/code><\/pre>\n<hr>\n<pre><code class=\"js\">\/\/ appends &quot;v&quot; to the end of a array &quot;a&quot;\nappend(any[] a, any v){}<\/code><\/pre>\n<p>\u4e4b\u540e\u662f\u4f18\u5316\u4e86\u5185\u7f6e\u51fd\u6570 <code>append()<\/code> \u7684\u8bed\u4e49\uff0c\u672c\u6b21\u4f18\u5316\u6765\u81ea\u4e8e issue12 \u7684\u5efa\u8bae\uff1a<br \/><a href=\"https:\/\/link.segmentfault.com\/?enc=OzP0D5txhD4NnJ9bAZZnrA%3D%3D.EulIX4L79X6J7EP4TSLBEc7WHbgohSzxonRj%2BnZzGLPo0nNHWOlc2jORvDi2ljRubFUf2gPEXNC7RUdGOdG1iQ%3D%3D\" rel=\"nofollow\">https:\/\/github.com\/crossoverJie\/gscript\/issues\/12<\/a><\/p>\n<pre><code class=\"js\">\/\/ Before\nint[] a={1,2,3};\nprintln(a);\nprintln();\na = append(a,4);\nprintln(a);\n\/\/ Output: [1 2 3 4]\n\n\/\/ Now\nint[] a={1,2,3};\nprintln(a);\nprintln();\nappend(a,4);\nint b = a[3];\nassertEqual(4, b);\nprintln(a);\n\/\/ Output: [1 2 3 4]<\/code><\/pre>\n<p>\u73b0\u5728 <code>append<\/code> \u4e4b\u540e\u4e0d\u9700\u8981\u518d\u91cd\u65b0\u8d4b\u503c\uff0c\u4e5f\u4f1a\u8ffd\u52a0\u6570\u636e\uff0c\u4f18\u5316\u540e\u8fd9\u91cc\u770b\u8d77\u6765\u662f\u4e00\u4e2a\u503c\/\u5f15\u7528\u4f20\u9012\u7684\u95ee\u9898\uff0c\u4f46\u5176\u5b9e\u5e95\u5c42\u4e5f\u662f\u503c\u4f20\u9012\uff0c\u53ea\u662f\u5728\u8bed\u6cd5\u4e0a\u589e\u52a0\u4e86\u8fd9\u6837\u7684\u8bed\u6cd5\u7cd6\uff0c\u5e2e\u4f7f\u7528\u8005\u91cd\u65b0\u505a\u4e86\u4e00\u6b21\u8d4b\u503c\u3002<\/p>\n<hr>\n<p>\u4e4b\u540e\u662f\u65b0\u589e\u4e86\u7f16\u8bd1\u9519\u8bef\u4fe1\u606f\u63d0\u793a\uff0c\u6bd4\u5982\u4e0b\u9762\u8fd9\u6bb5\u4ee3\u7801\uff1a<\/p>\n<pre><code class=\"js\">a+2;\nb+c;<\/code><\/pre>\n<p>\u4f7f\u7528\u6ca1\u6709\u58f0\u660e\u7684\u53d8\u91cf\uff0c\u73b0\u5728\u4f1a\u76f4\u63a5\u7f16\u8bd1\u5931\u8d25\uff1a<\/p>\n<pre><code class=\"shell\">1:0: undefined: a\n2:0: undefined: b\n2:2: undefined: c<\/code><\/pre>\n<pre><code class=\"js\">class T{}\nclass T{}\n\n\/\/ output:\n2:0: class T redeclared in this block<\/code><\/pre>\n<p>\u91cd\u590d\u58f0\u660e\u4e4b\u7c7b\u7684\u8bed\u6cd5\u9519\u8bef\u4e5f\u6709\u76f8\u5173\u63d0\u793a\u3002<\/p>\n<hr>\n<p>\u6700\u540e\u4e00\u4e2a\u624d\u662f\u672c\u6b21\u8ba8\u8bba\u7684\u91cd\u70b9\uff0c\u4e5f\u5c31\u662f\u9012\u5f52\u51fd\u6570\u7684\u652f\u6301\u3002<\/p>\n<pre><code class=\"js\">int num(int x,int y){\n    if (y==1 || y ==x) {\n        return 1;\n    }\n    int v1 = num(x - 1, y - 1);\n    return c;\n}<\/code><\/pre>\n<p>\u518d\u4e0a\u4e00\u4e2a\u7248\u672c\u4e2d <code>int v1 = num(x - 1, y - 1);<\/code> \u8fd9\u884c\u4ee3\u7801\u662f\u4e0d\u4f1a\u6267\u884c\u7684\uff0c\u5177\u4f53\u539f\u56e0\u540e\u6587\u4f1a\u5206\u6790\u3002<\/p>\n<p>\u73b0\u5728\u5229\u7528\u9012\u5f52\u4fbf\u53ef\u4ee5\u5b9e\u73b0\u7c7b\u4f3c\u4e8e<code>\u6253\u5370\u6768\u8f89\u4e09\u89d2<\/code>\u4e4b\u7c7b\u7684\u7a0b\u5e8f\u4e86\uff1a<\/p>\n<pre><code class=\"js\">int num(int x,int y){\n    if (y==1 || y ==x) {\n        return 1;\n    }\n    int v1 = num(x - 1, y - 1);\n    int v2 = num(x - 1, y);\n    int c = v1+v2;\n    \/\/ int c = num(x - 1, y - 1)+num(x - 1, y);\n    return c;\n}\nprintTriangle(int row){\n    for (int i = 1; i &lt;= row; i++) {\n        for (int j = 1; j &lt;= row - i; j++) {\n           print(&quot; &quot;);\n        }\n        for (int j = 1; j &lt;= i; j++) {\n            print(num(i, j) + &quot; &quot;);\n        }\n        println(&quot;&quot;);\n    }\n}\nprintTriangle(7);\n\n\/\/ output:\n      1 \n     1 1 \n    1 2 1 \n   1 3 3 1 \n  1 4 6 4 1 \n 1 5 10 10 5 1 \n1 6 15 20 15 6 1 <\/code><\/pre>\n<h2>\u51fd\u6570\u4e2d\u7684 return<\/h2>\n<pre><code class=\"js\">int num(int x,int y){\n    if (y==1 || y ==x) {\n        return 1;\n    }\n    int v1 = num(x - 1, y - 1);\n    return c;\n}<\/code><\/pre>\n<p>\u73b0\u5728\u6211\u4eec\u6765\u770b\u770b\u8fd9\u6837\u7684\u4ee3\u7801\u4e3a\u4ec0\u4e48\u6267\u884c\u5b8c <code>return 1<\/code> \u4e4b\u540e\u5c31\u4e0d\u4f1a\u6267\u884c\u540e\u8fb9\u7684\u8bed\u53e5\u4e86\u3002<\/p>\n<p>\u5176\u5b9e\u5728\u6b64\u4e4b\u524d\u6211\u9996\u5148\u89e3\u51b3\u7684\u65f6\u5019\u51fd\u6570 <code>return<\/code> \u540e\u4e0d\u80fd\u6267\u884c\u540e\u7eed <code>statement<\/code> \u7684\u9700\u6c42\uff0c\u5176\u5b9e\u6b63\u597d\u5c31\u662f\u4e0a\u6587\u63d0\u5230\u7684\u903b\u8f91\uff0c\u53ea\u662f\u8fd9\u91cc\u662f\u9012\u5f52\u800c\u5df2\u3002<\/p>\n<p>\u5148\u628a\u4ee3\u7801\u7b80\u5316\u4e00\u4e0b\u65b9\u4fbf\u5206\u6790\uff1a<\/p>\n<pre><code class=\"js\">int f1(int a){\n    if (a==10){\n        return 10;\n    }\n    println(&quot;abc&quot;);\n}<\/code><\/pre>\n<p>\u5f53\u53c2\u6570 a \u7b49\u4e8e 10 \u7684\u65f6\u5019\u786e\u5b9e\u4e0d\u80fd\u6267\u884c\u540e\u7eed\u7684\u6253\u5370\u8bed\u53e5\u4e86\uff0c\u90a3\u4e48\u5982\u4f55\u5b9e\u73b0\u8be5\u9700\u6c42\u5462\uff1f<\/p>\n<p>\u4ee5\u6b63\u5e38\u4eba\u7c7b\u7684\u601d\u8003\u65b9\u5f0f\uff1a\u5f53\u6211\u4eec\u6267\u884c\u5b8c <code>return<\/code> \u8bed\u53e5\u7684\u65f6\u5019\uff0c\u5c31\u5e94\u8be5\u6807\u8bb0\u8be5\u8bed\u53e5\u6240\u5c5e\u7684\u51fd\u6570\u76f4\u63a5\u8fd4\u56de\uff0c\u4e0d\u80fd\u5728\u6267\u884c\u540e\u7eed\u7684 <code>statement<\/code>\u3002<\/p>\n<p>\u53ef\u662f\u8fd9\u5e94\u8be5\u5982\u4f55\u5b9e\u64cd\u5462\uff1f<\/p>\n<p>\u5176\u5b9e\u770b\u770b <code>AST<\/code> \u5c31\u80fd\u660e\u767d\u4e86\uff1a<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000042548567\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<p>\u5f53\u78b0\u5230 <code>return<\/code> \u8bed\u53e5\u7684\u65f6\uff0c\u4f1a\u9012\u5f52\u5411\u4e0a\u904d\u5386\u8bed\u6cd5\u6811\uff0c\u6807\u8bb0\u4e0a\u6240\u6709 <code>block<\/code> \u8282\u70b9\u8868\u660e\u8fd9\u4e2a <code>block<\/code> \u540e\u7eed\u7684\u8bed\u53e5\u4e0d\u518d\u6267\u884c\u4e86\uff0c\u540c\u65f6\u8fd8\u5f97\u628a\u8fd4\u56de\u503c\u8bb0\u5f55\u4e0b\u6765\u3002<\/p>\n<p>\u8fd9\u6837\u5f53\u6267\u884c\u5230\u4e0b\u4e00\u4e2a <code>statement<\/code> \u65f6\uff0c\u4e5f\u5c31\u662f <code>    println(&quot;abc&quot;);<\/code> \u5219\u4f1a\u5224\u65ad\u4ed6\u6240\u5c5e\u7684 <code>block<\/code> \u662f\u5426\u6709\u88ab\u6807\u8bb0\uff0c\u5982\u679c\u6709\u5219\u76f4\u63a5\u8fd4\u56de\uff0c\u8fd9\u6837\u4fbf\u5b9e\u73b0\u4e86 <code>return<\/code> \u8bed\u53e5\u4e0d\u6267\u884c\u540e\u7eed\u4ee3\u7801\u3002<\/p>\n<p>\u90e8\u5206\u5b9e\u73b0\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<pre><code class=\"go\">\/\/ \u5728 return \u7684\u65f6\u5019\u9012\u5f52\u5411\u4e0a\u626b\u63cf\u6240\u6709\u7684 Block\uff0c\u5e76\u6253\u4e0a\u6807\u8bb0\uff0c\u7528\u4e8e\u540e\u9762\u6267\u884c return \u7684\u65f6\u5019\u76f4\u63a5\u8fd4\u56de\u3002\nfunc (v *Visitor) scanBlockStatementCtx(tree antlr.ParseTree, value interface{}) {\n    context, ok := tree.(*parser.BlockContext)\n    if ok {\n        if v.blockCtx2Mark == nil {\n            v.blockCtx2Mark = make(map[*parser.BlockContext]interface{})\n        }\n        v.blockCtx2Mark[context] = value\n    }\n    if tree.GetParent() != nil {\n        v.scanBlockStatementCtx(tree.GetParent().(antlr.ParseTree), value)\n    }\n}<\/code><\/pre>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000042548568\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<p>\u6e90\u7801\u5730\u5740\uff1a<br \/><a href=\"https:\/\/link.segmentfault.com\/?enc=Zryht4gRZ2jfXQuZiAl2Eg%3D%3D.49vtDpf2z8iDpaPw0ZT7TUfjfKO4zraRZHHerWt5ujHk5B5asBA%2BV1F4GHG7JfemCjZ%2FfpAzxk5cXRNXCr5oEubRm8AKBGWkVY90d0ExRzETXzXPeVnddLAHsCvFKVRrRlHnTsitkaTQpdrhx%2BBQmA%3D%3D\" rel=\"nofollow\">https:\/\/github.com\/crossoverJie\/gscript\/blob\/793d196244416574bd6be641534742e57c54db7a\/visitor.go#L182<\/a><\/p>\n<h2>\u9012\u5f52\u7684\u95ee\u9898<\/h2>\n<p>\u4f46\u540c\u65f6\u95ee\u9898\u4e5f\u6765\u4e86\uff0c\u5c31\u662f\u9012\u5f52\u7684\u65f6\u5019\u4e5f\u4e0d\u4f1a\u6267\u884c\u540e\u7eed\u7684\u9012\u5f52\u4ee3\u7801\u4e86\u3002<\/p>\n<p>\u5176\u5b9e\u89e3\u51b3\u95ee\u9898\u7684\u65b9\u6cd5\u4e5f\u5f88\u7b80\u5355\uff0c\u5c31\u662f\u5728\u5224\u65ad\u662f\u5426\u9700\u8981\u76f4\u63a5\u8fd4\u56de\u90a3\u91cc\u65b0\u589e\u4e00\u4e2a\u6761\u4ef6\uff0c\u8fd9\u4e2a <code>block<\/code> \u4e2d\u4e0d\u5b58\u5728\u9012\u5f52\u8c03\u7528\u3002<\/p>\n<p>\u6240\u4ee5\u6211\u4eec\u5c31\u5f97\u5148\u77e5\u9053\u8fd9\u4e2a <code>block<\/code> \u4e2d\u662f\u5426\u5b58\u5728\u9012\u5f52\u8c03\u7528\u3002<\/p>\n<p>\u6574\u4e2a\u8fc7\u7a0b\u6709\u4ee5\u4e0b\u51e0\u6b65\uff1a<\/p>\n<ul>\n<li>\u7f16\u8bd1\u671f\uff1a\u5728\u51fd\u6570\u58f0\u660e\u5904\u8bb0\u5f55\u4e0b\u51fd\u6570\u4e0e\u5f53\u524d <code>context<\/code> \u7684\u6620\u5c04\u5173\u7cfb\u3002<\/li>\n<li>\u7f16\u8bd1\u671f\uff1a\u626b\u63cf <code>statement<\/code> \u65f6\uff0c\u53d6\u51fa\u8be5 <code>statement<\/code> \u7684 <code>context<\/code> \u6240\u5bf9\u5e94\u7684\u51fd\u6570\u3002<\/li>\n<li>\u7f16\u8bd1\u671f\uff1a\u626b\u63cf\u5230\u7684 <code>statement<\/code> \u5982\u679c\u662f\u4e00\u4e2a\u51fd\u6570\u8c03\u7528\uff0c\u5219\u5224\u65ad\u8be5\u51fd\u6570\u662f\u5426\u4e3a\u8be5 <code>block<\/code> \u4e2d\u7684\u51fd\u6570\uff0c\u4e5f\u5c31\u662f\u7b2c\u4e8c\u6b65\u53d6\u51fa\u7684\u51fd\u6570\u3002<\/li>\n<li>\u7f16\u8bd1\u671f\uff1a\u5982\u679c\u4e24\u4e2a\u51fd\u6570\u76f8\u7b49\uff0c\u5219\u5c06\u5f53\u524d <code>block<\/code> \u6807\u8bb0\u4e3a\u9012\u5f52\u8c03\u7528\u3002<\/li>\n<li>\u8fd0\u884c\u671f\uff1a\u5728\u521a\u624d\u5224\u65ad <code>return<\/code> \u8bed\u53e5\u5904\uff0c\u989d\u5916\u591a\u51fa\u5224\u65ad\u5f53\u524d <code>block<\/code> \u662f\u5426\u4e3a\u9012\u5f52\u8c03\u7528\uff0c\u5982\u679c\u662f\u5219\u4e0d\u80fd\u8fd4\u56de\u3002<\/li>\n<\/ul>\n<p>\u90e8\u5206\u4ee3\u7801\u5982\u4e0b\uff1a<br \/><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000042548569\" alt=\"\" title=\"\" loading=\"lazy\"><br \/><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000042548570\" alt=\"\" title=\"\" loading=\"lazy\"><\/p>\n<p><a href=\"https:\/\/link.segmentfault.com\/?enc=naIWtNlM134yFP7DJM8xdw%3D%3D.LOOKxRQG3L2MIi7KVSX3mLN6h2ff3l41wJFh9ajKTknH8%2BvtUVuZmLhG%2FZdDEdNCWjS56tPR8uH3Rt6iOGQLxrus2nDReoLR9mRgKEkl3ulUoPdU%2BfQFDz%2FLICbCOyzXO65mc%2Fz11yiJ0%2Bd6%2BNObkvPkr03S%2FGtGmP7DgLsoOd8%3D\" rel=\"nofollow\">https:\/\/github.com\/crossoverJie\/gscript\/blob\/3e179f27cb30ca5c3af57b3fbf2e46075baa266b\/resolver\/ref_resolver.go#L70<\/a><\/p>\n<h2>\u603b\u7ed3<\/h2>\n<p>\u8fd9\u91cc\u7684\u9012\u5f52\u8c03\u7528\u5176\u5b9e\u5361\u4e86\u6211\u633a\u957f\u65f6\u95f4\u7684\uff0c\u601d\u8def\u662f\u6709\u7684\uff0c\u4f46\u662f\u5199\u51fa\u6765\u7684\u4ee3\u7801\u603b\u662f\u548c\u9884\u671f\u4e0d\u7b26\uff0c\u5f53\u5929\u665a\u4e0a\u5750\u5728\u7535\u8111\u9762\u524d\u5230\u51cc\u6668\u4e24\u4e09\u70b9\uff0c\u767e\u601d\u4e0d\u5f97\u5176\u89e3\u3002<\/p>\n<p>\u6700\u540e\u53d7\u4e0d\u4e86\u4e0a\u5e8a\u4f11\u606f\u7684\u65f6\u5019\uff0c\u7a81\u7136\u4e00\u4e2a\u7075\u5149\u4e4d\u73b0\u8ba9\u6211\u60f3\u5230\u4e86\u89e3\u51b3\u65b9\u6848\uff0c\u4e8e\u662f\u7b2c\u4e8c\u5929\u8d77\u4e86\u4e2a\u65e9\u5e8a\u8d76\u5fd9\u5b9e\u8df5\uff0c\u8fd8\u771f\u7ed9\u89e3\u51b3\u4e86\u3002<\/p>\n<p>\u6240\u4ee5\u6709\u4e9b\u65f6\u5019\u78b0\u5230\u68d8\u624b\u95ee\u9898\u65f6\u7ed9\u81ea\u5df1\u653e\u677e\u4e00\u4e0b\uff0c\u5f80\u5f80\u4f1a\u6709\u51fa\u5176\u4e0d\u610f\u7684\u6548\u679c\u3002<\/p>\n<p>\u6700\u540e\u662f\u76ee\u524d\u7684\u9012\u5f52\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\u6027\u80fd\u8fd8\u6709\u4e9b\u95ee\u9898\uff0c\u540e\u7eed\u4f1a\u5c3d\u91cf\u5c06\u8fd9\u4e9b\u6807\u8bb0\u8fc7\u7a0b\u90fd\u653e\u5728\u7f16\u8bd1\u671f\uff0c\u7f16\u8bd1\u6162\u70b9\u6ca1\u4e8b\uff0c\u4f46\u8fd0\u884c\u65f6\u6162\u90a3\u5c31\u6709\u95ee\u9898\u4e86\u3002<\/p>\n<p>\u4e4b\u540e\u8fd8\u4f1a\u7ee7\u7eed\u4f18\u5316\u8fd0\u884c\u65f6\u7684\u5f02\u5e38\uff0c\u76ee\u524d\u662f\u76f4\u63a5 <code>panic<\/code>\uff0c\u5806\u6808\u4e5f\u6ca1\u6709\uff0c\u4f53\u611f\u975e\u5e38\u4e0d\u597d\uff1b\u6b22\u8fce\u611f\u5174\u8da3\u7684\u670b\u53cb\u8bd5\u7528\u53cd\u9988bug\u3002<\/p>\n<p>\u6e90\u7801\u5730\u5740\uff1a<\/p>\n<p><a href=\"https:\/\/link.segmentfault.com\/?enc=XaeXXnGzDIzs5PkD2AHJLw%3D%3D.JPkVh87GfP80MB7ZifLcOuxw92rmaV31S0XvYQj98mcPbBtoGatA%2BnHIbCwJjCOl\" rel=\"nofollow\">https:\/\/github.com\/crossoverJie\/gscript<\/a><\/p>\n<p><a href=\"https:\/\/segmentfault.com\/a\/1190000042548565\">https:\/\/segmentfault.com\/a\/1190000042548565<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u8a00 \u672c\u7bc7\u6587\u7ae0\u4e3b\u8981\u662f\u8bb0\u5f55\u4e00\u4e0b\u5728 GScript \u4e2d\u5b9e\u73b0\u9012\u5f52\u8c03\u7528\u65f6\u6240\u9047\u5230\u7684\u5751\uff0c\u7c7b\u4f3c\u7684\u95ee\u9898\u5728\u4e2d\u6587\u4e92\u8054\u7f51\u4e0a\u6211\u51e0\u4e4e\u6ca1\u6709 [&hellip;]<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[],"tags":[],"class_list":["post-10006610","post","type-post","status-publish","format-standard","hentry"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts\/10006610","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10006610"}],"version-history":[{"count":0,"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts\/10006610\/revisions"}],"wp:attachment":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10006610"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10006610"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10006610"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}