{"action":"created","comment":{"url":"https://api.github.com/repos/rust-lang/rfcs/pulls/comments/24773553","id":24773553,"diff_hunk":"@@ -74,31 +74,36 @@ The algorithm for recognizing valid matchers `M` follows. Note that a matcher\n is merely a token tree. A \"simple NT\" is an NT without repetitions. That is,\n `$foo:ty` is a simple NT but `$($foo:ty)+` is not. `FOLLOW(NT)` is the set of\n allowed tokens for the given NT's fragment specifier, and is defined below.\n-`F` is used for representing the separator in complex NTs.  In `$($foo:ty),+`,\n-`F` would be `,`, and for `$($foo:ty)+`, `F` would be `EOF`.\n \n-*input*: a token tree `M` representing a matcher and a token `F`\n-\n-*output*: whether M is valid\n-\n-For each token `T` in `M`:\n-\n-1. If `T` is not an NT, continue.\n-2. If `T` is a simple NT, look ahead to the next token `T'` in `M`. If\n-   `T'` is `EOF` or a close delimiter of a token tree, replace `T'` with\n-   `F`. If `T'` is in the set `FOLLOW(NT)`, `T'` is EOF, or `T'` is any close\n-   delimiter, continue. Otherwise, reject.\n-3. Else, `T` is a complex NT.\n-    1. If `T` has the form `$(...)+` or `$(...)*`, run the algorithm on the\n-       contents with `F` set to the token following `T`. If it accepts,\n-       continue, else, reject.\n-    2. If `T` has the form `$(...)U+` or `$(...)U*` for some token `U`, run\n-       the algorithm on the contents with `F` set to `U`. If it accepts,\n-       check that the last token in the sequence can be followed by `F`. If\n-       so, accept. Otherwise, reject.\n+`CHECK(M, F):` *input*: a sequence of tokens `M` and a set of tokens `F`; *output*: whether M is valid.\n+  1. If `M` is empty, accept.\n+  2. Set `t = HEAD(M)`\n+  3. If `t` is not an NT, skip to 7.\n+  4. Find `S`, the set of possible successors of `t`:\n+    1. If `TAIL(M)` is empty, set `S = F`,\n+    2. Else, `S = LEADERS(TAIL(M))`.\n+  5. If `t` is a simple NT, check that `S` is a subset of `FOLLOW(t)`.","path":"text/0550-macro-future-proofing.md","position":33,"original_position":33,"commit_id":"38ff99a8b70c16198fca1787cb96ca9186ba30a3","original_commit_id":"38ff99a8b70c16198fca1787cb96ca9186ba30a3","user":{"login":"vadimcn","id":3203809,"avatar_url":"https://avatars.githubusercontent.com/u/3203809?v=3","gravatar_id":"","url":"https://api.github.com/users/vadimcn","html_url":"https://github.com/vadimcn","followers_url":"https://api.github.com/users/vadimcn/followers","following_url":"https://api.github.com/users/vadimcn/following{/other_user}","gists_url":"https://api.github.com/users/vadimcn/gists{/gist_id}","starred_url":"https://api.github.com/users/vadimcn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vadimcn/subscriptions","organizations_url":"https://api.github.com/users/vadimcn/orgs","repos_url":"https://api.github.com/users/vadimcn/repos","events_url":"https://api.github.com/users/vadimcn/events{/privacy}","received_events_url":"https://api.github.com/users/vadimcn/received_events","type":"User","site_admin":false},"body":"I just used the original @cmr's definitions of 'simple' and complex'.   I'll add a clarification as you asked above.","created_at":"2015-02-16T20:20:10Z","updated_at":"2015-02-16T20:20:10Z","html_url":"https://github.com/rust-lang/rfcs/pull/733#discussion_r24773553","pull_request_url":"https://api.github.com/repos/rust-lang/rfcs/pulls/733","_links":{"self":{"href":"https://api.github.com/repos/rust-lang/rfcs/pulls/comments/24773553"},"html":{"href":"https://github.com/rust-lang/rfcs/pull/733#discussion_r24773553"},"pull_request":{"href":"https://api.github.com/repos/rust-lang/rfcs/pulls/733"}}},"pull_request":{"url":"https://api.github.com/repos/rust-lang/rfcs/pulls/733","id":27982714,"html_url":"https://github.com/rust-lang/rfcs/pull/733","diff_url":"https://github.com/rust-lang/rfcs/pull/733.diff","patch_url":"https://github.com/rust-lang/rfcs/pull/733.patch","issue_url":"https://api.github.com/repos/rust-lang/rfcs/issues/733","number":733,"state":"open","locked":false,"title":"Amend macro future proofing RFC","user":{"login":"vadimcn","id":3203809,"avatar_url":"https://avatars.githubusercontent.com/u/3203809?v=3","gravatar_id":"","url":"https://api.github.com/users/vadimcn","html_url":"https://github.com/vadimcn","followers_url":"https://api.github.com/users/vadimcn/followers","following_url":"https://api.github.com/users/vadimcn/following{/other_user}","gists_url":"https://api.github.com/users/vadimcn/gists{/gist_id}","starred_url":"https://api.github.com/users/vadimcn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vadimcn/subscriptions","organizations_url":"https://api.github.com/users/vadimcn/orgs","repos_url":"https://api.github.com/users/vadimcn/repos","events_url":"https://api.github.com/users/vadimcn/events{/privacy}","received_events_url":"https://api.github.com/users/vadimcn/received_events","type":"User","site_admin":false},"body":"Proposed changes:\r\n- Add Semicolon to FOLLOW(ty).\r\n- Modify algorithm to allow repetitions after NTs.\r\n\r\n[(rendered)](https://github.com/vadimcn/rfcs/blob/amend-macro-future-proofing/text/0550-macro-future-proofing.md)","created_at":"2015-01-24T21:34:25Z","updated_at":"2015-02-16T20:20:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fd075e37eef720f36c45a1e8aec973af0fe50068","assignee":{"login":"pnkfelix","id":173127,"avatar_url":"https://avatars.githubusercontent.com/u/173127?v=3","gravatar_id":"","url":"https://api.github.com/users/pnkfelix","html_url":"https://github.com/pnkfelix","followers_url":"https://api.github.com/users/pnkfelix/followers","following_url":"https://api.github.com/users/pnkfelix/following{/other_user}","gists_url":"https://api.github.com/users/pnkfelix/gists{/gist_id}","starred_url":"https://api.github.com/users/pnkfelix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pnkfelix/subscriptions","organizations_url":"https://api.github.com/users/pnkfelix/orgs","repos_url":"https://api.github.com/users/pnkfelix/repos","events_url":"https://api.github.com/users/pnkfelix/events{/privacy}","received_events_url":"https://api.github.com/users/pnkfelix/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/rust-lang/rfcs/pulls/733/commits","review_comments_url":"https://api.github.com/repos/rust-lang/rfcs/pulls/733/comments","review_comment_url":"https://api.github.com/repos/rust-lang/rfcs/pulls/comments/{number}","comments_url":"https://api.github.com/repos/rust-lang/rfcs/issues/733/comments","statuses_url":"https://api.github.com/repos/rust-lang/rfcs/statuses/38ff99a8b70c16198fca1787cb96ca9186ba30a3","head":{"label":"vadimcn:amend-macro-future-proofing","ref":"amend-macro-future-proofing","sha":"38ff99a8b70c16198fca1787cb96ca9186ba30a3","user":{"login":"vadimcn","id":3203809,"avatar_url":"https://avatars.githubusercontent.com/u/3203809?v=3","gravatar_id":"","url":"https://api.github.com/users/vadimcn","html_url":"https://github.com/vadimcn","followers_url":"https://api.github.com/users/vadimcn/followers","following_url":"https://api.github.com/users/vadimcn/following{/other_user}","gists_url":"https://api.github.com/users/vadimcn/gists{/gist_id}","starred_url":"https://api.github.com/users/vadimcn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vadimcn/subscriptions","organizations_url":"https://api.github.com/users/vadimcn/orgs","repos_url":"https://api.github.com/users/vadimcn/repos","events_url":"https://api.github.com/users/vadimcn/events{/privacy}","received_events_url":"https://api.github.com/users/vadimcn/received_events","type":"User","site_admin":false},"repo":{"id":18453082,"name":"rfcs","full_name":"vadimcn/rfcs","owner":{"login":"vadimcn","id":3203809,"avatar_url":"https://avatars.githubusercontent.com/u/3203809?v=3","gravatar_id":"","url":"https://api.github.com/users/vadimcn","html_url":"https://github.com/vadimcn","followers_url":"https://api.github.com/users/vadimcn/followers","following_url":"https://api.github.com/users/vadimcn/following{/other_user}","gists_url":"https://api.github.com/users/vadimcn/gists{/gist_id}","starred_url":"https://api.github.com/users/vadimcn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vadimcn/subscriptions","organizations_url":"https://api.github.com/users/vadimcn/orgs","repos_url":"https://api.github.com/users/vadimcn/repos","events_url":"https://api.github.com/users/vadimcn/events{/privacy}","received_events_url":"https://api.github.com/users/vadimcn/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vadimcn/rfcs","description":"RFCs for changes to Rust","fork":true,"url":"https://api.github.com/repos/vadimcn/rfcs","forks_url":"https://api.github.com/repos/vadimcn/rfcs/forks","keys_url":"https://api.github.com/repos/vadimcn/rfcs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vadimcn/rfcs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vadimcn/rfcs/teams","hooks_url":"https://api.github.com/repos/vadimcn/rfcs/hooks","issue_events_url":"https://api.github.com/repos/vadimcn/rfcs/issues/events{/number}","events_url":"https://api.github.com/repos/vadimcn/rfcs/events","assignees_url":"https://api.github.com/repos/vadimcn/rfcs/assignees{/user}","branches_url":"https://api.github.com/repos/vadimcn/rfcs/branches{/branch}","tags_url":"https://api.github.com/repos/vadimcn/rfcs/tags","blobs_url":"https://api.github.com/repos/vadimcn/rfcs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vadimcn/rfcs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vadimcn/rfcs/git/refs{/sha}","trees_url":"https://api.github.com/repos/vadimcn/rfcs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vadimcn/rfcs/statuses/{sha}","languages_url":"https://api.github.com/repos/vadimcn/rfcs/languages","stargazers_url":"https://api.github.com/repos/vadimcn/rfcs/stargazers","contributors_url":"https://api.github.com/repos/vadimcn/rfcs/contributors","subscribers_url":"https://api.github.com/repos/vadimcn/rfcs/subscribers","subscription_url":"https://api.github.com/repos/vadimcn/rfcs/subscription","commits_url":"https://api.github.com/repos/vadimcn/rfcs/commits{/sha}","git_commits_url":"https://api.github.com/repos/vadimcn/rfcs/git/commits{/sha}","comments_url":"https://api.github.com/repos/vadimcn/rfcs/comments{/number}","issue_comment_url":"https://api.github.com/repos/vadimcn/rfcs/issues/comments/{number}","contents_url":"https://api.github.com/repos/vadimcn/rfcs/contents/{+path}","compare_url":"https://api.github.com/repos/vadimcn/rfcs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vadimcn/rfcs/merges","archive_url":"https://api.github.com/repos/vadimcn/rfcs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vadimcn/rfcs/downloads","issues_url":"https://api.github.com/repos/vadimcn/rfcs/issues{/number}","pulls_url":"https://api.github.com/repos/vadimcn/rfcs/pulls{/number}","milestones_url":"https://api.github.com/repos/vadimcn/rfcs/milestones{/number}","notifications_url":"https://api.github.com/repos/vadimcn/rfcs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vadimcn/rfcs/labels{/name}","releases_url":"https://api.github.com/repos/vadimcn/rfcs/releases{/id}","created_at":"2014-04-04T21:20:18Z","updated_at":"2014-04-25T02:53:32Z","pushed_at":"2015-01-30T07:14:56Z","git_url":"git://github.com/vadimcn/rfcs.git","ssh_url":"git@github.com:vadimcn/rfcs.git","clone_url":"https://github.com/vadimcn/rfcs.git","svn_url":"https://github.com/vadimcn/rfcs","homepage":"","size":1440,"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":"rust-lang:master","ref":"master","sha":"efb783a79c9987e678ed8e8e5ca9db0de70f512c","user":{"login":"rust-lang","id":5430905,"avatar_url":"https://avatars.githubusercontent.com/u/5430905?v=3","gravatar_id":"","url":"https://api.github.com/users/rust-lang","html_url":"https://github.com/rust-lang","followers_url":"https://api.github.com/users/rust-lang/followers","following_url":"https://api.github.com/users/rust-lang/following{/other_user}","gists_url":"https://api.github.com/users/rust-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/rust-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rust-lang/subscriptions","organizations_url":"https://api.github.com/users/rust-lang/orgs","repos_url":"https://api.github.com/users/rust-lang/repos","events_url":"https://api.github.com/users/rust-lang/events{/privacy}","received_events_url":"https://api.github.com/users/rust-lang/received_events","type":"Organization","site_admin":false},"repo":{"id":17527989,"name":"rfcs","full_name":"rust-lang/rfcs","owner":{"login":"rust-lang","id":5430905,"avatar_url":"https://avatars.githubusercontent.com/u/5430905?v=3","gravatar_id":"","url":"https://api.github.com/users/rust-lang","html_url":"https://github.com/rust-lang","followers_url":"https://api.github.com/users/rust-lang/followers","following_url":"https://api.github.com/users/rust-lang/following{/other_user}","gists_url":"https://api.github.com/users/rust-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/rust-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rust-lang/subscriptions","organizations_url":"https://api.github.com/users/rust-lang/orgs","repos_url":"https://api.github.com/users/rust-lang/repos","events_url":"https://api.github.com/users/rust-lang/events{/privacy}","received_events_url":"https://api.github.com/users/rust-lang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rust-lang/rfcs","description":"RFCs for changes to Rust","fork":false,"url":"https://api.github.com/repos/rust-lang/rfcs","forks_url":"https://api.github.com/repos/rust-lang/rfcs/forks","keys_url":"https://api.github.com/repos/rust-lang/rfcs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rust-lang/rfcs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rust-lang/rfcs/teams","hooks_url":"https://api.github.com/repos/rust-lang/rfcs/hooks","issue_events_url":"https://api.github.com/repos/rust-lang/rfcs/issues/events{/number}","events_url":"https://api.github.com/repos/rust-lang/rfcs/events","assignees_url":"https://api.github.com/repos/rust-lang/rfcs/assignees{/user}","branches_url":"https://api.github.com/repos/rust-lang/rfcs/branches{/branch}","tags_url":"https://api.github.com/repos/rust-lang/rfcs/tags","blobs_url":"https://api.github.com/repos/rust-lang/rfcs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rust-lang/rfcs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rust-lang/rfcs/git/refs{/sha}","trees_url":"https://api.github.com/repos/rust-lang/rfcs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rust-lang/rfcs/statuses/{sha}","languages_url":"https://api.github.com/repos/rust-lang/rfcs/languages","stargazers_url":"https://api.github.com/repos/rust-lang/rfcs/stargazers","contributors_url":"https://api.github.com/repos/rust-lang/rfcs/contributors","subscribers_url":"https://api.github.com/repos/rust-lang/rfcs/subscribers","subscription_url":"https://api.github.com/repos/rust-lang/rfcs/subscription","commits_url":"https://api.github.com/repos/rust-lang/rfcs/commits{/sha}","git_commits_url":"https://api.github.com/repos/rust-lang/rfcs/git/commits{/sha}","comments_url":"https://api.github.com/repos/rust-lang/rfcs/comments{/number}","issue_comment_url":"https://api.github.com/repos/rust-lang/rfcs/issues/comments/{number}","contents_url":"https://api.github.com/repos/rust-lang/rfcs/contents/{+path}","compare_url":"https://api.github.com/repos/rust-lang/rfcs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rust-lang/rfcs/merges","archive_url":"https://api.github.com/repos/rust-lang/rfcs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rust-lang/rfcs/downloads","issues_url":"https://api.github.com/repos/rust-lang/rfcs/issues{/number}","pulls_url":"https://api.github.com/repos/rust-lang/rfcs/pulls{/number}","milestones_url":"https://api.github.com/repos/rust-lang/rfcs/milestones{/number}","notifications_url":"https://api.github.com/repos/rust-lang/rfcs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rust-lang/rfcs/labels{/name}","releases_url":"https://api.github.com/repos/rust-lang/rfcs/releases{/id}","created_at":"2014-03-07T21:29:00Z","updated_at":"2015-02-16T05:53:45Z","pushed_at":"2015-02-16T18:40:11Z","git_url":"git://github.com/rust-lang/rfcs.git","ssh_url":"git@github.com:rust-lang/rfcs.git","clone_url":"https://github.com/rust-lang/rfcs.git","svn_url":"https://github.com/rust-lang/rfcs","homepage":"","size":7944,"stargazers_count":261,"watchers_count":261,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":160,"mirror_url":null,"open_issues_count":428,"forks":160,"open_issues":428,"watchers":261,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rust-lang/rfcs/pulls/733"},"html":{"href":"https://github.com/rust-lang/rfcs/pull/733"},"issue":{"href":"https://api.github.com/repos/rust-lang/rfcs/issues/733"},"comments":{"href":"https://api.github.com/repos/rust-lang/rfcs/issues/733/comments"},"review_comments":{"href":"https://api.github.com/repos/rust-lang/rfcs/pulls/733/comments"},"review_comment":{"href":"https://api.github.com/repos/rust-lang/rfcs/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/rust-lang/rfcs/pulls/733/commits"},"statuses":{"href":"https://api.github.com/repos/rust-lang/rfcs/statuses/38ff99a8b70c16198fca1787cb96ca9186ba30a3"}}}}