{"action":"created","comment":{"url":"https://api.github.com/repos/xitu/gold-miner/pulls/comments/69858009","id":69858009,"diff_hunk":"@@ -81,22 +82,22 @@ The token creation part of the Lexer is not very exciting: it’s one big switch\n       }\n     }\n \n-And here are the helper methods, to consume the tokens:\n+这里是处理 Token 的一些助手方法：\n \n-*   `next(Token)`: returns whether the next token matches `Token`;\n-*   `skip(Token)`: same as `next`, but skips the token if it matches;\n-*   `match(Token)`: assert that `next` is true, and `skip`;\n-*   `token(Token)`: assert that `next` is true, and return the token.\n+*   `next(Token)`：返回是否下一个 Token 匹配 `Token`；\n+*   `skip(Token)`：和 `next` 相同, 但是如果匹配则跳过；\n+*   `match(Token)`：断言 `next` 是 true, 并且 `skip`；\n+*   `token(Token)`：断言 `next` 是 true, 并且将其返回。\n \n-Okay, now, to the `Parser`!\n+好了，现在继续进行 `Parser` ！\n \n ## 4\\. Parser\n \n-The parser is basically a copy of the grammar. We create one method for each production rule, based on its name (in the left-hand side of the `::=`) and follow the right-hand side: If it’s an all caps word, it means it’s a _terminal_ (i.e. a token), and we consume it from the lexer. If it’s a capitalised word, it’s another production, so we call the method for it. When we find an `|` (reads `or`) we have to decide which side to use, we’ll do that based which of the sides match the tokens we have.\n+Parser 基本上是语法的拷贝。我们基于产生式规则的名字（ `::=` 左边的部分）给每个产生式规则创建了一个方法， `::=` 右边则遵循以下规则：如果字母都是大写的，那么就是一个_终结符_（例如：一个 Token ），并且我们可以使用 Lexer 处理它；如果右边是一个（首字母）大写的单词，那么则是另一个产生式，因此我们可以给它调用方法。当我们看到一个 `|` （读作 `or`）时，我们需要决定去使用哪边，具体取决于哪边匹配 Token 。\n \n-There’s only one tricky bit about this grammar: hand written parsers are usually [recursive descent](https://en.wikipedia.org/wiki/Recursive_descent_parser) (ours will be), and they can’t handle left recursion. You might have noticed that the right-hand side of the `Application` production, contains `Application` itself in the first position, so if we just follow the procedure described in the previous paragraph, where we call all the productions we find, we’ll have an infinite recursion.\n+语法中只有一个棘手的部分，手写的 Parser 通常是[递归下降](https://en.wikipedia.org/wiki/Recursive_descent_parser)（我们的经常是），并且它们无法处理左递归。你可能注意到 `Application` 产生式的右边，在第一个位置包含了 `Application` 本身，所以我们只是遵循上一段提到的产生规则的话，当我们调用看到的所有产生式时将会导致无限递归。","path":"TODO/writing-a-lambda-calculus-interpreter-in-javascrip.md","position":110,"original_position":110,"commit_id":"e87b791ce9194fa1b3b1f03026dbdeb76a06cef2","original_commit_id":"e87b791ce9194fa1b3b1f03026dbdeb76a06cef2","user":{"login":"Zheaoli","id":7054676,"avatar_url":"https://avatars.githubusercontent.com/u/7054676?v=3","gravatar_id":"","url":"https://api.github.com/users/Zheaoli","html_url":"https://github.com/Zheaoli","followers_url":"https://api.github.com/users/Zheaoli/followers","following_url":"https://api.github.com/users/Zheaoli/following{/other_user}","gists_url":"https://api.github.com/users/Zheaoli/gists{/gist_id}","starred_url":"https://api.github.com/users/Zheaoli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zheaoli/subscriptions","organizations_url":"https://api.github.com/users/Zheaoli/orgs","repos_url":"https://api.github.com/users/Zheaoli/repos","events_url":"https://api.github.com/users/Zheaoli/events{/privacy}","received_events_url":"https://api.github.com/users/Zheaoli/received_events","type":"User","site_admin":false},"body":"我们的经常是 这是什么鬼= =\r\n这里可能修改为通常而言是这样的？","created_at":"2016-07-07T06:47:08Z","updated_at":"2016-07-07T06:47:08Z","html_url":"https://github.com/xitu/gold-miner/pull/482#discussion_r69858009","pull_request_url":"https://api.github.com/repos/xitu/gold-miner/pulls/482","_links":{"self":{"href":"https://api.github.com/repos/xitu/gold-miner/pulls/comments/69858009"},"html":{"href":"https://github.com/xitu/gold-miner/pull/482#discussion_r69858009"},"pull_request":{"href":"https://api.github.com/repos/xitu/gold-miner/pulls/482"}}},"pull_request":{"url":"https://api.github.com/repos/xitu/gold-miner/pulls/482","id":76187045,"html_url":"https://github.com/xitu/gold-miner/pull/482","diff_url":"https://github.com/xitu/gold-miner/pull/482.diff","patch_url":"https://github.com/xitu/gold-miner/pull/482.patch","issue_url":"https://api.github.com/repos/xitu/gold-miner/issues/482","number":482,"state":"open","locked":false,"title":"[用 Javascript 编写λ演算解释器]--初稿","user":{"login":"joddiy","id":14108933,"avatar_url":"https://avatars.githubusercontent.com/u/14108933?v=3","gravatar_id":"","url":"https://api.github.com/users/joddiy","html_url":"https://github.com/joddiy","followers_url":"https://api.github.com/users/joddiy/followers","following_url":"https://api.github.com/users/joddiy/following{/other_user}","gists_url":"https://api.github.com/users/joddiy/gists{/gist_id}","starred_url":"https://api.github.com/users/joddiy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joddiy/subscriptions","organizations_url":"https://api.github.com/users/joddiy/orgs","repos_url":"https://api.github.com/users/joddiy/repos","events_url":"https://api.github.com/users/joddiy/events{/privacy}","received_events_url":"https://api.github.com/users/joddiy/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-07-04T16:58:19Z","updated_at":"2016-07-07T06:47:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8f202de58fd4ea9817a4af2f8babaf4b2d9a80c5","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/xitu/gold-miner/pulls/482/commits","review_comments_url":"https://api.github.com/repos/xitu/gold-miner/pulls/482/comments","review_comment_url":"https://api.github.com/repos/xitu/gold-miner/pulls/comments{/number}","comments_url":"https://api.github.com/repos/xitu/gold-miner/issues/482/comments","statuses_url":"https://api.github.com/repos/xitu/gold-miner/statuses/e87b791ce9194fa1b3b1f03026dbdeb76a06cef2","head":{"label":"joddiy:translate","ref":"translate","sha":"e87b791ce9194fa1b3b1f03026dbdeb76a06cef2","user":{"login":"joddiy","id":14108933,"avatar_url":"https://avatars.githubusercontent.com/u/14108933?v=3","gravatar_id":"","url":"https://api.github.com/users/joddiy","html_url":"https://github.com/joddiy","followers_url":"https://api.github.com/users/joddiy/followers","following_url":"https://api.github.com/users/joddiy/following{/other_user}","gists_url":"https://api.github.com/users/joddiy/gists{/gist_id}","starred_url":"https://api.github.com/users/joddiy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joddiy/subscriptions","organizations_url":"https://api.github.com/users/joddiy/orgs","repos_url":"https://api.github.com/users/joddiy/repos","events_url":"https://api.github.com/users/joddiy/events{/privacy}","received_events_url":"https://api.github.com/users/joddiy/received_events","type":"User","site_admin":false},"repo":{"id":62125355,"name":"gold-miner","full_name":"joddiy/gold-miner","owner":{"login":"joddiy","id":14108933,"avatar_url":"https://avatars.githubusercontent.com/u/14108933?v=3","gravatar_id":"","url":"https://api.github.com/users/joddiy","html_url":"https://github.com/joddiy","followers_url":"https://api.github.com/users/joddiy/followers","following_url":"https://api.github.com/users/joddiy/following{/other_user}","gists_url":"https://api.github.com/users/joddiy/gists{/gist_id}","starred_url":"https://api.github.com/users/joddiy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joddiy/subscriptions","organizations_url":"https://api.github.com/users/joddiy/orgs","repos_url":"https://api.github.com/users/joddiy/repos","events_url":"https://api.github.com/users/joddiy/events{/privacy}","received_events_url":"https://api.github.com/users/joddiy/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/joddiy/gold-miner","description":"掘金翻译计划，翻译掘金上优质的英文文章","fork":true,"url":"https://api.github.com/repos/joddiy/gold-miner","forks_url":"https://api.github.com/repos/joddiy/gold-miner/forks","keys_url":"https://api.github.com/repos/joddiy/gold-miner/keys{/key_id}","collaborators_url":"https://api.github.com/repos/joddiy/gold-miner/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/joddiy/gold-miner/teams","hooks_url":"https://api.github.com/repos/joddiy/gold-miner/hooks","issue_events_url":"https://api.github.com/repos/joddiy/gold-miner/issues/events{/number}","events_url":"https://api.github.com/repos/joddiy/gold-miner/events","assignees_url":"https://api.github.com/repos/joddiy/gold-miner/assignees{/user}","branches_url":"https://api.github.com/repos/joddiy/gold-miner/branches{/branch}","tags_url":"https://api.github.com/repos/joddiy/gold-miner/tags","blobs_url":"https://api.github.com/repos/joddiy/gold-miner/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/joddiy/gold-miner/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/joddiy/gold-miner/git/refs{/sha}","trees_url":"https://api.github.com/repos/joddiy/gold-miner/git/trees{/sha}","statuses_url":"https://api.github.com/repos/joddiy/gold-miner/statuses/{sha}","languages_url":"https://api.github.com/repos/joddiy/gold-miner/languages","stargazers_url":"https://api.github.com/repos/joddiy/gold-miner/stargazers","contributors_url":"https://api.github.com/repos/joddiy/gold-miner/contributors","subscribers_url":"https://api.github.com/repos/joddiy/gold-miner/subscribers","subscription_url":"https://api.github.com/repos/joddiy/gold-miner/subscription","commits_url":"https://api.github.com/repos/joddiy/gold-miner/commits{/sha}","git_commits_url":"https://api.github.com/repos/joddiy/gold-miner/git/commits{/sha}","comments_url":"https://api.github.com/repos/joddiy/gold-miner/comments{/number}","issue_comment_url":"https://api.github.com/repos/joddiy/gold-miner/issues/comments{/number}","contents_url":"https://api.github.com/repos/joddiy/gold-miner/contents/{+path}","compare_url":"https://api.github.com/repos/joddiy/gold-miner/compare/{base}...{head}","merges_url":"https://api.github.com/repos/joddiy/gold-miner/merges","archive_url":"https://api.github.com/repos/joddiy/gold-miner/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/joddiy/gold-miner/downloads","issues_url":"https://api.github.com/repos/joddiy/gold-miner/issues{/number}","pulls_url":"https://api.github.com/repos/joddiy/gold-miner/pulls{/number}","milestones_url":"https://api.github.com/repos/joddiy/gold-miner/milestones{/number}","notifications_url":"https://api.github.com/repos/joddiy/gold-miner/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/joddiy/gold-miner/labels{/name}","releases_url":"https://api.github.com/repos/joddiy/gold-miner/releases{/id}","deployments_url":"https://api.github.com/repos/joddiy/gold-miner/deployments","created_at":"2016-06-28T08:50:59Z","updated_at":"2016-06-28T08:45:42Z","pushed_at":"2016-07-05T16:12:46Z","git_url":"git://github.com/joddiy/gold-miner.git","ssh_url":"git@github.com:joddiy/gold-miner.git","clone_url":"https://github.com/joddiy/gold-miner.git","svn_url":"https://github.com/joddiy/gold-miner","homepage":"http://gold.xitu.io","size":13509,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"xitu:master","ref":"master","sha":"7fabc04b6924e229fc7c3d14b9ca4385389baeef","user":{"login":"xitu","id":10482599,"avatar_url":"https://avatars.githubusercontent.com/u/10482599?v=3","gravatar_id":"","url":"https://api.github.com/users/xitu","html_url":"https://github.com/xitu","followers_url":"https://api.github.com/users/xitu/followers","following_url":"https://api.github.com/users/xitu/following{/other_user}","gists_url":"https://api.github.com/users/xitu/gists{/gist_id}","starred_url":"https://api.github.com/users/xitu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xitu/subscriptions","organizations_url":"https://api.github.com/users/xitu/orgs","repos_url":"https://api.github.com/users/xitu/repos","events_url":"https://api.github.com/users/xitu/events{/privacy}","received_events_url":"https://api.github.com/users/xitu/received_events","type":"Organization","site_admin":false},"repo":{"id":45512989,"name":"gold-miner","full_name":"xitu/gold-miner","owner":{"login":"xitu","id":10482599,"avatar_url":"https://avatars.githubusercontent.com/u/10482599?v=3","gravatar_id":"","url":"https://api.github.com/users/xitu","html_url":"https://github.com/xitu","followers_url":"https://api.github.com/users/xitu/followers","following_url":"https://api.github.com/users/xitu/following{/other_user}","gists_url":"https://api.github.com/users/xitu/gists{/gist_id}","starred_url":"https://api.github.com/users/xitu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xitu/subscriptions","organizations_url":"https://api.github.com/users/xitu/orgs","repos_url":"https://api.github.com/users/xitu/repos","events_url":"https://api.github.com/users/xitu/events{/privacy}","received_events_url":"https://api.github.com/users/xitu/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/xitu/gold-miner","description":"掘金翻译计划，翻译掘金上优质的英文文章","fork":false,"url":"https://api.github.com/repos/xitu/gold-miner","forks_url":"https://api.github.com/repos/xitu/gold-miner/forks","keys_url":"https://api.github.com/repos/xitu/gold-miner/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xitu/gold-miner/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xitu/gold-miner/teams","hooks_url":"https://api.github.com/repos/xitu/gold-miner/hooks","issue_events_url":"https://api.github.com/repos/xitu/gold-miner/issues/events{/number}","events_url":"https://api.github.com/repos/xitu/gold-miner/events","assignees_url":"https://api.github.com/repos/xitu/gold-miner/assignees{/user}","branches_url":"https://api.github.com/repos/xitu/gold-miner/branches{/branch}","tags_url":"https://api.github.com/repos/xitu/gold-miner/tags","blobs_url":"https://api.github.com/repos/xitu/gold-miner/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xitu/gold-miner/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xitu/gold-miner/git/refs{/sha}","trees_url":"https://api.github.com/repos/xitu/gold-miner/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xitu/gold-miner/statuses/{sha}","languages_url":"https://api.github.com/repos/xitu/gold-miner/languages","stargazers_url":"https://api.github.com/repos/xitu/gold-miner/stargazers","contributors_url":"https://api.github.com/repos/xitu/gold-miner/contributors","subscribers_url":"https://api.github.com/repos/xitu/gold-miner/subscribers","subscription_url":"https://api.github.com/repos/xitu/gold-miner/subscription","commits_url":"https://api.github.com/repos/xitu/gold-miner/commits{/sha}","git_commits_url":"https://api.github.com/repos/xitu/gold-miner/git/commits{/sha}","comments_url":"https://api.github.com/repos/xitu/gold-miner/comments{/number}","issue_comment_url":"https://api.github.com/repos/xitu/gold-miner/issues/comments{/number}","contents_url":"https://api.github.com/repos/xitu/gold-miner/contents/{+path}","compare_url":"https://api.github.com/repos/xitu/gold-miner/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xitu/gold-miner/merges","archive_url":"https://api.github.com/repos/xitu/gold-miner/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xitu/gold-miner/downloads","issues_url":"https://api.github.com/repos/xitu/gold-miner/issues{/number}","pulls_url":"https://api.github.com/repos/xitu/gold-miner/pulls{/number}","milestones_url":"https://api.github.com/repos/xitu/gold-miner/milestones{/number}","notifications_url":"https://api.github.com/repos/xitu/gold-miner/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xitu/gold-miner/labels{/name}","releases_url":"https://api.github.com/repos/xitu/gold-miner/releases{/id}","deployments_url":"https://api.github.com/repos/xitu/gold-miner/deployments","created_at":"2015-11-04T03:29:13Z","updated_at":"2016-07-07T06:45:59Z","pushed_at":"2016-07-07T03:28:11Z","git_url":"git://github.com/xitu/gold-miner.git","ssh_url":"git@github.com:xitu/gold-miner.git","clone_url":"https://github.com/xitu/gold-miner.git","svn_url":"https://github.com/xitu/gold-miner","homepage":"http://gold.xitu.io","size":14352,"stargazers_count":2268,"watchers_count":2268,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":432,"mirror_url":null,"open_issues_count":26,"forks":432,"open_issues":26,"watchers":2268,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/xitu/gold-miner/pulls/482"},"html":{"href":"https://github.com/xitu/gold-miner/pull/482"},"issue":{"href":"https://api.github.com/repos/xitu/gold-miner/issues/482"},"comments":{"href":"https://api.github.com/repos/xitu/gold-miner/issues/482/comments"},"review_comments":{"href":"https://api.github.com/repos/xitu/gold-miner/pulls/482/comments"},"review_comment":{"href":"https://api.github.com/repos/xitu/gold-miner/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/xitu/gold-miner/pulls/482/commits"},"statuses":{"href":"https://api.github.com/repos/xitu/gold-miner/statuses/e87b791ce9194fa1b3b1f03026dbdeb76a06cef2"}}}}
{"actor":{"display_login":"Zheaoli"}}