{"action":"closed","number":2414,"pull_request":{"url":"https://api.github.com/repos/crystal-lang/crystal/pulls/2414","id":65259032,"html_url":"https://github.com/crystal-lang/crystal/pull/2414","diff_url":"https://github.com/crystal-lang/crystal/pull/2414.diff","patch_url":"https://github.com/crystal-lang/crystal/pull/2414.patch","issue_url":"https://api.github.com/repos/crystal-lang/crystal/issues/2414","number":2414,"state":"closed","locked":false,"title":"Block arg '&' dose not always follow no whitespace","user":{"login":"MakeNowJust","id":6679325,"avatar_url":"https://avatars.githubusercontent.com/u/6679325?v=3","gravatar_id":"","url":"https://api.github.com/users/MakeNowJust","html_url":"https://github.com/MakeNowJust","followers_url":"https://api.github.com/users/MakeNowJust/followers","following_url":"https://api.github.com/users/MakeNowJust/following{/other_user}","gists_url":"https://api.github.com/users/MakeNowJust/gists{/gist_id}","starred_url":"https://api.github.com/users/MakeNowJust/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MakeNowJust/subscriptions","organizations_url":"https://api.github.com/users/MakeNowJust/orgs","repos_url":"https://api.github.com/users/MakeNowJust/repos","events_url":"https://api.github.com/users/MakeNowJust/events{/privacy}","received_events_url":"https://api.github.com/users/MakeNowJust/received_events","type":"User","site_admin":false},"body":"What no-whitespace check is needed on is only when block arg is passed as first argument and method calling is not wrapped by parentheses, because such a case cannot ditinguish between block arg '&' and binary operator '&'. e.g.\r\n\r\n```crystal\r\nfoo 1, & bar # == foo(1, &bar)\r\nfoo(& bar)   # == foo(&bar)\r\n\r\nfoo & bar    # which dose it mean 'foo(&bar)' or '(foo & bar)'?\r\n             # curretly, it parsed to '(foo & bar)'.\r\n```\r\n\r\nYou may think this fix makes syntax more complex. Don't worry, plus '+' and minus '-' syntax have same complexity already. e.g.\r\n\r\n```crystal\r\nfoo +1  # == foo(+1)\r\nfoo + 1 # == (foo + 1)\r\n```\r\n\r\nCurrent implementation accepts only no-whitespace case, dose not accept following whitespace case. This behavior is different from Ruby, and this change is useful to write some complex expression as block args.\r\n\r\nNote: no-whitespace following check is [here](https://github.com/crystal-lang/crystal/blob/6e6afd4442d2dc0d32643c74931729e892504120/src/compiler/crystal/syntax/parser.cr#L3524-L3525).","created_at":"2016-04-05T06:53:42Z","updated_at":"2016-05-30T15:31:02Z","closed_at":"2016-05-30T15:31:02Z","merged_at":null,"merge_commit_sha":"9046d471b388a897678ee6a9a5c9a42840901fb3","assignee":{"login":"asterite","id":209371,"avatar_url":"https://avatars.githubusercontent.com/u/209371?v=3","gravatar_id":"","url":"https://api.github.com/users/asterite","html_url":"https://github.com/asterite","followers_url":"https://api.github.com/users/asterite/followers","following_url":"https://api.github.com/users/asterite/following{/other_user}","gists_url":"https://api.github.com/users/asterite/gists{/gist_id}","starred_url":"https://api.github.com/users/asterite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asterite/subscriptions","organizations_url":"https://api.github.com/users/asterite/orgs","repos_url":"https://api.github.com/users/asterite/repos","events_url":"https://api.github.com/users/asterite/events{/privacy}","received_events_url":"https://api.github.com/users/asterite/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/crystal-lang/crystal/pulls/2414/commits","review_comments_url":"https://api.github.com/repos/crystal-lang/crystal/pulls/2414/comments","review_comment_url":"https://api.github.com/repos/crystal-lang/crystal/pulls/comments{/number}","comments_url":"https://api.github.com/repos/crystal-lang/crystal/issues/2414/comments","statuses_url":"https://api.github.com/repos/crystal-lang/crystal/statuses/b6e9e4fd3407bc64dd1649008bfd1660afc85857","head":{"label":"MakeNowJust:fix/block-args-ampersand-not-following-no-whitespace-always","ref":"fix/block-args-ampersand-not-following-no-whitespace-always","sha":"b6e9e4fd3407bc64dd1649008bfd1660afc85857","user":{"login":"MakeNowJust","id":6679325,"avatar_url":"https://avatars.githubusercontent.com/u/6679325?v=3","gravatar_id":"","url":"https://api.github.com/users/MakeNowJust","html_url":"https://github.com/MakeNowJust","followers_url":"https://api.github.com/users/MakeNowJust/followers","following_url":"https://api.github.com/users/MakeNowJust/following{/other_user}","gists_url":"https://api.github.com/users/MakeNowJust/gists{/gist_id}","starred_url":"https://api.github.com/users/MakeNowJust/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MakeNowJust/subscriptions","organizations_url":"https://api.github.com/users/MakeNowJust/orgs","repos_url":"https://api.github.com/users/MakeNowJust/repos","events_url":"https://api.github.com/users/MakeNowJust/events{/privacy}","received_events_url":"https://api.github.com/users/MakeNowJust/received_events","type":"User","site_admin":false},"repo":{"id":38912767,"name":"crystal","full_name":"MakeNowJust/crystal","owner":{"login":"MakeNowJust","id":6679325,"avatar_url":"https://avatars.githubusercontent.com/u/6679325?v=3","gravatar_id":"","url":"https://api.github.com/users/MakeNowJust","html_url":"https://github.com/MakeNowJust","followers_url":"https://api.github.com/users/MakeNowJust/followers","following_url":"https://api.github.com/users/MakeNowJust/following{/other_user}","gists_url":"https://api.github.com/users/MakeNowJust/gists{/gist_id}","starred_url":"https://api.github.com/users/MakeNowJust/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MakeNowJust/subscriptions","organizations_url":"https://api.github.com/users/MakeNowJust/orgs","repos_url":"https://api.github.com/users/MakeNowJust/repos","events_url":"https://api.github.com/users/MakeNowJust/events{/privacy}","received_events_url":"https://api.github.com/users/MakeNowJust/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/MakeNowJust/crystal","description":"The Crystal Programming Language","fork":true,"url":"https://api.github.com/repos/MakeNowJust/crystal","forks_url":"https://api.github.com/repos/MakeNowJust/crystal/forks","keys_url":"https://api.github.com/repos/MakeNowJust/crystal/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MakeNowJust/crystal/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MakeNowJust/crystal/teams","hooks_url":"https://api.github.com/repos/MakeNowJust/crystal/hooks","issue_events_url":"https://api.github.com/repos/MakeNowJust/crystal/issues/events{/number}","events_url":"https://api.github.com/repos/MakeNowJust/crystal/events","assignees_url":"https://api.github.com/repos/MakeNowJust/crystal/assignees{/user}","branches_url":"https://api.github.com/repos/MakeNowJust/crystal/branches{/branch}","tags_url":"https://api.github.com/repos/MakeNowJust/crystal/tags","blobs_url":"https://api.github.com/repos/MakeNowJust/crystal/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MakeNowJust/crystal/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MakeNowJust/crystal/git/refs{/sha}","trees_url":"https://api.github.com/repos/MakeNowJust/crystal/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MakeNowJust/crystal/statuses/{sha}","languages_url":"https://api.github.com/repos/MakeNowJust/crystal/languages","stargazers_url":"https://api.github.com/repos/MakeNowJust/crystal/stargazers","contributors_url":"https://api.github.com/repos/MakeNowJust/crystal/contributors","subscribers_url":"https://api.github.com/repos/MakeNowJust/crystal/subscribers","subscription_url":"https://api.github.com/repos/MakeNowJust/crystal/subscription","commits_url":"https://api.github.com/repos/MakeNowJust/crystal/commits{/sha}","git_commits_url":"https://api.github.com/repos/MakeNowJust/crystal/git/commits{/sha}","comments_url":"https://api.github.com/repos/MakeNowJust/crystal/comments{/number}","issue_comment_url":"https://api.github.com/repos/MakeNowJust/crystal/issues/comments{/number}","contents_url":"https://api.github.com/repos/MakeNowJust/crystal/contents/{+path}","compare_url":"https://api.github.com/repos/MakeNowJust/crystal/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MakeNowJust/crystal/merges","archive_url":"https://api.github.com/repos/MakeNowJust/crystal/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MakeNowJust/crystal/downloads","issues_url":"https://api.github.com/repos/MakeNowJust/crystal/issues{/number}","pulls_url":"https://api.github.com/repos/MakeNowJust/crystal/pulls{/number}","milestones_url":"https://api.github.com/repos/MakeNowJust/crystal/milestones{/number}","notifications_url":"https://api.github.com/repos/MakeNowJust/crystal/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MakeNowJust/crystal/labels{/name}","releases_url":"https://api.github.com/repos/MakeNowJust/crystal/releases{/id}","deployments_url":"https://api.github.com/repos/MakeNowJust/crystal/deployments","created_at":"2015-07-11T03:48:50Z","updated_at":"2016-01-13T09:13:15Z","pushed_at":"2016-05-29T16:11:27Z","git_url":"git://github.com/MakeNowJust/crystal.git","ssh_url":"git@github.com:MakeNowJust/crystal.git","clone_url":"https://github.com/MakeNowJust/crystal.git","svn_url":"https://github.com/MakeNowJust/crystal","homepage":"http://crystal-lang.org","size":36065,"stargazers_count":0,"watchers_count":0,"language":"Crystal","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":"crystal-lang:master","ref":"master","sha":"8e31380387a81652723c3f3ca4d92ef02d57b973","user":{"login":"crystal-lang","id":6539796,"avatar_url":"https://avatars.githubusercontent.com/u/6539796?v=3","gravatar_id":"","url":"https://api.github.com/users/crystal-lang","html_url":"https://github.com/crystal-lang","followers_url":"https://api.github.com/users/crystal-lang/followers","following_url":"https://api.github.com/users/crystal-lang/following{/other_user}","gists_url":"https://api.github.com/users/crystal-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/crystal-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crystal-lang/subscriptions","organizations_url":"https://api.github.com/users/crystal-lang/orgs","repos_url":"https://api.github.com/users/crystal-lang/repos","events_url":"https://api.github.com/users/crystal-lang/events{/privacy}","received_events_url":"https://api.github.com/users/crystal-lang/received_events","type":"Organization","site_admin":false},"repo":{"id":6887813,"name":"crystal","full_name":"crystal-lang/crystal","owner":{"login":"crystal-lang","id":6539796,"avatar_url":"https://avatars.githubusercontent.com/u/6539796?v=3","gravatar_id":"","url":"https://api.github.com/users/crystal-lang","html_url":"https://github.com/crystal-lang","followers_url":"https://api.github.com/users/crystal-lang/followers","following_url":"https://api.github.com/users/crystal-lang/following{/other_user}","gists_url":"https://api.github.com/users/crystal-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/crystal-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crystal-lang/subscriptions","organizations_url":"https://api.github.com/users/crystal-lang/orgs","repos_url":"https://api.github.com/users/crystal-lang/repos","events_url":"https://api.github.com/users/crystal-lang/events{/privacy}","received_events_url":"https://api.github.com/users/crystal-lang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/crystal-lang/crystal","description":"The Crystal Programming Language","fork":false,"url":"https://api.github.com/repos/crystal-lang/crystal","forks_url":"https://api.github.com/repos/crystal-lang/crystal/forks","keys_url":"https://api.github.com/repos/crystal-lang/crystal/keys{/key_id}","collaborators_url":"https://api.github.com/repos/crystal-lang/crystal/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/crystal-lang/crystal/teams","hooks_url":"https://api.github.com/repos/crystal-lang/crystal/hooks","issue_events_url":"https://api.github.com/repos/crystal-lang/crystal/issues/events{/number}","events_url":"https://api.github.com/repos/crystal-lang/crystal/events","assignees_url":"https://api.github.com/repos/crystal-lang/crystal/assignees{/user}","branches_url":"https://api.github.com/repos/crystal-lang/crystal/branches{/branch}","tags_url":"https://api.github.com/repos/crystal-lang/crystal/tags","blobs_url":"https://api.github.com/repos/crystal-lang/crystal/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/crystal-lang/crystal/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/crystal-lang/crystal/git/refs{/sha}","trees_url":"https://api.github.com/repos/crystal-lang/crystal/git/trees{/sha}","statuses_url":"https://api.github.com/repos/crystal-lang/crystal/statuses/{sha}","languages_url":"https://api.github.com/repos/crystal-lang/crystal/languages","stargazers_url":"https://api.github.com/repos/crystal-lang/crystal/stargazers","contributors_url":"https://api.github.com/repos/crystal-lang/crystal/contributors","subscribers_url":"https://api.github.com/repos/crystal-lang/crystal/subscribers","subscription_url":"https://api.github.com/repos/crystal-lang/crystal/subscription","commits_url":"https://api.github.com/repos/crystal-lang/crystal/commits{/sha}","git_commits_url":"https://api.github.com/repos/crystal-lang/crystal/git/commits{/sha}","comments_url":"https://api.github.com/repos/crystal-lang/crystal/comments{/number}","issue_comment_url":"https://api.github.com/repos/crystal-lang/crystal/issues/comments{/number}","contents_url":"https://api.github.com/repos/crystal-lang/crystal/contents/{+path}","compare_url":"https://api.github.com/repos/crystal-lang/crystal/compare/{base}...{head}","merges_url":"https://api.github.com/repos/crystal-lang/crystal/merges","archive_url":"https://api.github.com/repos/crystal-lang/crystal/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/crystal-lang/crystal/downloads","issues_url":"https://api.github.com/repos/crystal-lang/crystal/issues{/number}","pulls_url":"https://api.github.com/repos/crystal-lang/crystal/pulls{/number}","milestones_url":"https://api.github.com/repos/crystal-lang/crystal/milestones{/number}","notifications_url":"https://api.github.com/repos/crystal-lang/crystal/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/crystal-lang/crystal/labels{/name}","releases_url":"https://api.github.com/repos/crystal-lang/crystal/releases{/id}","deployments_url":"https://api.github.com/repos/crystal-lang/crystal/deployments","created_at":"2012-11-27T17:32:32Z","updated_at":"2016-05-30T15:24:57Z","pushed_at":"2016-05-30T09:00:01Z","git_url":"git://github.com/crystal-lang/crystal.git","ssh_url":"git@github.com:crystal-lang/crystal.git","clone_url":"https://github.com/crystal-lang/crystal.git","svn_url":"https://github.com/crystal-lang/crystal","homepage":"http://crystal-lang.org","size":59928,"stargazers_count":5049,"watchers_count":5049,"language":"Crystal","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":413,"mirror_url":null,"open_issues_count":232,"forks":413,"open_issues":232,"watchers":5049,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/crystal-lang/crystal/pulls/2414"},"html":{"href":"https://github.com/crystal-lang/crystal/pull/2414"},"issue":{"href":"https://api.github.com/repos/crystal-lang/crystal/issues/2414"},"comments":{"href":"https://api.github.com/repos/crystal-lang/crystal/issues/2414/comments"},"review_comments":{"href":"https://api.github.com/repos/crystal-lang/crystal/pulls/2414/comments"},"review_comment":{"href":"https://api.github.com/repos/crystal-lang/crystal/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/crystal-lang/crystal/pulls/2414/commits"},"statuses":{"href":"https://api.github.com/repos/crystal-lang/crystal/statuses/b6e9e4fd3407bc64dd1649008bfd1660afc85857"}},"merged":false,"mergeable":true,"mergeable_state":"clean","merged_by":null,"comments":3,"review_comments":0,"commits":1,"additions":4,"deletions":1,"changed_files":2}}
{"actor":{"display_login":"asterite"}}