{"action":"created","comment":{"url":"https://api.github.com/repos/deadalnix/libd/pulls/comments/27344158","id":27344158,"diff_hunk":"@@ -384,15 +382,28 @@ public:\n \t\t\n \t\tstart = buildImplicitCast(pass, start.location, type, start);\n \t\tstop  = buildImplicitCast(pass, stop.location, type, stop);\n-\t\tauto idx = new Variable(iDecl.location, type.getParamType(iDecl.type.isRef, false), iDecl.name, start);\n+\n+\t\tBinaryOp cmp_op;\n+\t\tUnaryOp inc_op;\n+\n+\t\tif (f.reverse) {\n+\t\t\tswap(start, stop);\n+\t\t\tcmp_op = BinaryOp.GreaterEqual;\n+\t\t\tinc_op = UnaryOp.PreDec;\n+\t\t} else {\n+\t\t\tcmp_op = BinaryOp.Less;\n+\t\t\tinc_op = UnaryOp.PreInc;\n+\t\t}\n \t\t\n+\t\tauto idx = new Variable(iDecl.location, type.getParamType(iDecl.type.isRef, false), iDecl.name, start);\n+\n \t\tidx.step = Step.Processed;\n \t\tcurrentScope.addSymbol(idx);\n \t\t\n-\t\tauto initialize = new SymbolStatement(idx);\n+\t\tauto initialize = f.reverse ? new ExpressionStatement(new UnaryExpression(loc, idx.type, UnaryOp.PreDec, idxExpr)) : new SymbolStatement(idx);","path":"src/d/semantic/statement.d","position":33,"original_position":33,"commit_id":"e33868859036e788cc054711b5fb156f43e2f124","original_commit_id":"e33868859036e788cc054711b5fb156f43e2f124","user":{"login":"UplinkCoder","id":2844936,"avatar_url":"https://avatars.githubusercontent.com/u/2844936?v=3","gravatar_id":"","url":"https://api.github.com/users/UplinkCoder","html_url":"https://github.com/UplinkCoder","followers_url":"https://api.github.com/users/UplinkCoder/followers","following_url":"https://api.github.com/users/UplinkCoder/following{/other_user}","gists_url":"https://api.github.com/users/UplinkCoder/gists{/gist_id}","starred_url":"https://api.github.com/users/UplinkCoder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UplinkCoder/subscriptions","organizations_url":"https://api.github.com/users/UplinkCoder/orgs","repos_url":"https://api.github.com/users/UplinkCoder/repos","events_url":"https://api.github.com/users/UplinkCoder/events{/privacy}","received_events_url":"https://api.github.com/users/UplinkCoder/received_events","type":"User","site_admin":false},"body":"doesn't work. it depends on idx...\r\nwhich I would then also have to duplicate...","created_at":"2015-03-28T10:56:02Z","updated_at":"2015-03-28T10:56:02Z","html_url":"https://github.com/deadalnix/libd/pull/57#discussion_r27344158","pull_request_url":"https://api.github.com/repos/deadalnix/libd/pulls/57","_links":{"self":{"href":"https://api.github.com/repos/deadalnix/libd/pulls/comments/27344158"},"html":{"href":"https://github.com/deadalnix/libd/pull/57#discussion_r27344158"},"pull_request":{"href":"https://api.github.com/repos/deadalnix/libd/pulls/57"}}},"pull_request":{"url":"https://api.github.com/repos/deadalnix/libd/pulls/57","id":31201666,"html_url":"https://github.com/deadalnix/libd/pull/57","diff_url":"https://github.com/deadalnix/libd/pull/57.diff","patch_url":"https://github.com/deadalnix/libd/pull/57.patch","issue_url":"https://api.github.com/repos/deadalnix/libd/issues/57","number":57,"state":"open","locked":false,"title":"added foreach_reverse for RangeForeach","user":{"login":"UplinkCoder","id":2844936,"avatar_url":"https://avatars.githubusercontent.com/u/2844936?v=3","gravatar_id":"","url":"https://api.github.com/users/UplinkCoder","html_url":"https://github.com/UplinkCoder","followers_url":"https://api.github.com/users/UplinkCoder/followers","following_url":"https://api.github.com/users/UplinkCoder/following{/other_user}","gists_url":"https://api.github.com/users/UplinkCoder/gists{/gist_id}","starred_url":"https://api.github.com/users/UplinkCoder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UplinkCoder/subscriptions","organizations_url":"https://api.github.com/users/UplinkCoder/orgs","repos_url":"https://api.github.com/users/UplinkCoder/repos","events_url":"https://api.github.com/users/UplinkCoder/events{/privacy}","received_events_url":"https://api.github.com/users/UplinkCoder/received_events","type":"User","site_admin":false},"body":"the test is in https://github.com/deadalnix/SDC/pull/93\r\n","created_at":"2015-03-15T15:15:51Z","updated_at":"2015-03-28T10:56:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"881aa53bedffa698932a0b308597b055a5067443","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/deadalnix/libd/pulls/57/commits","review_comments_url":"https://api.github.com/repos/deadalnix/libd/pulls/57/comments","review_comment_url":"https://api.github.com/repos/deadalnix/libd/pulls/comments{/number}","comments_url":"https://api.github.com/repos/deadalnix/libd/issues/57/comments","statuses_url":"https://api.github.com/repos/deadalnix/libd/statuses/e33868859036e788cc054711b5fb156f43e2f124","head":{"label":"UplinkCoder:range_foreach_reverse","ref":"range_foreach_reverse","sha":"e33868859036e788cc054711b5fb156f43e2f124","user":{"login":"UplinkCoder","id":2844936,"avatar_url":"https://avatars.githubusercontent.com/u/2844936?v=3","gravatar_id":"","url":"https://api.github.com/users/UplinkCoder","html_url":"https://github.com/UplinkCoder","followers_url":"https://api.github.com/users/UplinkCoder/followers","following_url":"https://api.github.com/users/UplinkCoder/following{/other_user}","gists_url":"https://api.github.com/users/UplinkCoder/gists{/gist_id}","starred_url":"https://api.github.com/users/UplinkCoder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UplinkCoder/subscriptions","organizations_url":"https://api.github.com/users/UplinkCoder/orgs","repos_url":"https://api.github.com/users/UplinkCoder/repos","events_url":"https://api.github.com/users/UplinkCoder/events{/privacy}","received_events_url":"https://api.github.com/users/UplinkCoder/received_events","type":"User","site_admin":false},"repo":{"id":15248588,"name":"libd","full_name":"UplinkCoder/libd","owner":{"login":"UplinkCoder","id":2844936,"avatar_url":"https://avatars.githubusercontent.com/u/2844936?v=3","gravatar_id":"","url":"https://api.github.com/users/UplinkCoder","html_url":"https://github.com/UplinkCoder","followers_url":"https://api.github.com/users/UplinkCoder/followers","following_url":"https://api.github.com/users/UplinkCoder/following{/other_user}","gists_url":"https://api.github.com/users/UplinkCoder/gists{/gist_id}","starred_url":"https://api.github.com/users/UplinkCoder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UplinkCoder/subscriptions","organizations_url":"https://api.github.com/users/UplinkCoder/orgs","repos_url":"https://api.github.com/users/UplinkCoder/repos","events_url":"https://api.github.com/users/UplinkCoder/events{/privacy}","received_events_url":"https://api.github.com/users/UplinkCoder/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/UplinkCoder/libd","description":"Implementation of the D programming language as a library.","fork":true,"url":"https://api.github.com/repos/UplinkCoder/libd","forks_url":"https://api.github.com/repos/UplinkCoder/libd/forks","keys_url":"https://api.github.com/repos/UplinkCoder/libd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/UplinkCoder/libd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/UplinkCoder/libd/teams","hooks_url":"https://api.github.com/repos/UplinkCoder/libd/hooks","issue_events_url":"https://api.github.com/repos/UplinkCoder/libd/issues/events{/number}","events_url":"https://api.github.com/repos/UplinkCoder/libd/events","assignees_url":"https://api.github.com/repos/UplinkCoder/libd/assignees{/user}","branches_url":"https://api.github.com/repos/UplinkCoder/libd/branches{/branch}","tags_url":"https://api.github.com/repos/UplinkCoder/libd/tags","blobs_url":"https://api.github.com/repos/UplinkCoder/libd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/UplinkCoder/libd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/UplinkCoder/libd/git/refs{/sha}","trees_url":"https://api.github.com/repos/UplinkCoder/libd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/UplinkCoder/libd/statuses/{sha}","languages_url":"https://api.github.com/repos/UplinkCoder/libd/languages","stargazers_url":"https://api.github.com/repos/UplinkCoder/libd/stargazers","contributors_url":"https://api.github.com/repos/UplinkCoder/libd/contributors","subscribers_url":"https://api.github.com/repos/UplinkCoder/libd/subscribers","subscription_url":"https://api.github.com/repos/UplinkCoder/libd/subscription","commits_url":"https://api.github.com/repos/UplinkCoder/libd/commits{/sha}","git_commits_url":"https://api.github.com/repos/UplinkCoder/libd/git/commits{/sha}","comments_url":"https://api.github.com/repos/UplinkCoder/libd/comments{/number}","issue_comment_url":"https://api.github.com/repos/UplinkCoder/libd/issues/comments{/number}","contents_url":"https://api.github.com/repos/UplinkCoder/libd/contents/{+path}","compare_url":"https://api.github.com/repos/UplinkCoder/libd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/UplinkCoder/libd/merges","archive_url":"https://api.github.com/repos/UplinkCoder/libd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/UplinkCoder/libd/downloads","issues_url":"https://api.github.com/repos/UplinkCoder/libd/issues{/number}","pulls_url":"https://api.github.com/repos/UplinkCoder/libd/pulls{/number}","milestones_url":"https://api.github.com/repos/UplinkCoder/libd/milestones{/number}","notifications_url":"https://api.github.com/repos/UplinkCoder/libd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/UplinkCoder/libd/labels{/name}","releases_url":"https://api.github.com/repos/UplinkCoder/libd/releases{/id}","created_at":"2013-12-17T08:02:38Z","updated_at":"2015-03-27T19:28:13Z","pushed_at":"2015-03-28T08:41:44Z","git_url":"git://github.com/UplinkCoder/libd.git","ssh_url":"git@github.com:UplinkCoder/libd.git","clone_url":"https://github.com/UplinkCoder/libd.git","svn_url":"https://github.com/UplinkCoder/libd","homepage":"","size":2309,"stargazers_count":0,"watchers_count":0,"language":"D","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"deadalnix:master","ref":"master","sha":"8be08ad8007c9694a7b8f2cf65740d17f39f68e2","user":{"login":"deadalnix","id":854121,"avatar_url":"https://avatars.githubusercontent.com/u/854121?v=3","gravatar_id":"","url":"https://api.github.com/users/deadalnix","html_url":"https://github.com/deadalnix","followers_url":"https://api.github.com/users/deadalnix/followers","following_url":"https://api.github.com/users/deadalnix/following{/other_user}","gists_url":"https://api.github.com/users/deadalnix/gists{/gist_id}","starred_url":"https://api.github.com/users/deadalnix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deadalnix/subscriptions","organizations_url":"https://api.github.com/users/deadalnix/orgs","repos_url":"https://api.github.com/users/deadalnix/repos","events_url":"https://api.github.com/users/deadalnix/events{/privacy}","received_events_url":"https://api.github.com/users/deadalnix/received_events","type":"User","site_admin":false},"repo":{"id":8681569,"name":"libd","full_name":"deadalnix/libd","owner":{"login":"deadalnix","id":854121,"avatar_url":"https://avatars.githubusercontent.com/u/854121?v=3","gravatar_id":"","url":"https://api.github.com/users/deadalnix","html_url":"https://github.com/deadalnix","followers_url":"https://api.github.com/users/deadalnix/followers","following_url":"https://api.github.com/users/deadalnix/following{/other_user}","gists_url":"https://api.github.com/users/deadalnix/gists{/gist_id}","starred_url":"https://api.github.com/users/deadalnix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deadalnix/subscriptions","organizations_url":"https://api.github.com/users/deadalnix/orgs","repos_url":"https://api.github.com/users/deadalnix/repos","events_url":"https://api.github.com/users/deadalnix/events{/privacy}","received_events_url":"https://api.github.com/users/deadalnix/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/deadalnix/libd","description":"Implementation of the D programming language as a library.","fork":false,"url":"https://api.github.com/repos/deadalnix/libd","forks_url":"https://api.github.com/repos/deadalnix/libd/forks","keys_url":"https://api.github.com/repos/deadalnix/libd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/deadalnix/libd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/deadalnix/libd/teams","hooks_url":"https://api.github.com/repos/deadalnix/libd/hooks","issue_events_url":"https://api.github.com/repos/deadalnix/libd/issues/events{/number}","events_url":"https://api.github.com/repos/deadalnix/libd/events","assignees_url":"https://api.github.com/repos/deadalnix/libd/assignees{/user}","branches_url":"https://api.github.com/repos/deadalnix/libd/branches{/branch}","tags_url":"https://api.github.com/repos/deadalnix/libd/tags","blobs_url":"https://api.github.com/repos/deadalnix/libd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/deadalnix/libd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/deadalnix/libd/git/refs{/sha}","trees_url":"https://api.github.com/repos/deadalnix/libd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/deadalnix/libd/statuses/{sha}","languages_url":"https://api.github.com/repos/deadalnix/libd/languages","stargazers_url":"https://api.github.com/repos/deadalnix/libd/stargazers","contributors_url":"https://api.github.com/repos/deadalnix/libd/contributors","subscribers_url":"https://api.github.com/repos/deadalnix/libd/subscribers","subscription_url":"https://api.github.com/repos/deadalnix/libd/subscription","commits_url":"https://api.github.com/repos/deadalnix/libd/commits{/sha}","git_commits_url":"https://api.github.com/repos/deadalnix/libd/git/commits{/sha}","comments_url":"https://api.github.com/repos/deadalnix/libd/comments{/number}","issue_comment_url":"https://api.github.com/repos/deadalnix/libd/issues/comments{/number}","contents_url":"https://api.github.com/repos/deadalnix/libd/contents/{+path}","compare_url":"https://api.github.com/repos/deadalnix/libd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/deadalnix/libd/merges","archive_url":"https://api.github.com/repos/deadalnix/libd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/deadalnix/libd/downloads","issues_url":"https://api.github.com/repos/deadalnix/libd/issues{/number}","pulls_url":"https://api.github.com/repos/deadalnix/libd/pulls{/number}","milestones_url":"https://api.github.com/repos/deadalnix/libd/milestones{/number}","notifications_url":"https://api.github.com/repos/deadalnix/libd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/deadalnix/libd/labels{/name}","releases_url":"https://api.github.com/repos/deadalnix/libd/releases{/id}","created_at":"2013-03-10T06:28:34Z","updated_at":"2015-03-25T06:23:31Z","pushed_at":"2015-03-28T08:41:44Z","git_url":"git://github.com/deadalnix/libd.git","ssh_url":"git@github.com:deadalnix/libd.git","clone_url":"https://github.com/deadalnix/libd.git","svn_url":"https://github.com/deadalnix/libd","homepage":"","size":3692,"stargazers_count":21,"watchers_count":21,"language":"D","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":15,"forks":10,"open_issues":15,"watchers":21,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/deadalnix/libd/pulls/57"},"html":{"href":"https://github.com/deadalnix/libd/pull/57"},"issue":{"href":"https://api.github.com/repos/deadalnix/libd/issues/57"},"comments":{"href":"https://api.github.com/repos/deadalnix/libd/issues/57/comments"},"review_comments":{"href":"https://api.github.com/repos/deadalnix/libd/pulls/57/comments"},"review_comment":{"href":"https://api.github.com/repos/deadalnix/libd/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/deadalnix/libd/pulls/57/commits"},"statuses":{"href":"https://api.github.com/repos/deadalnix/libd/statuses/e33868859036e788cc054711b5fb156f43e2f124"}}}}