{"action":"created","comment":{"url":"https://api.github.com/repos/HaxeFoundation/as3hx/pulls/comments/145944321","pull_request_review_id":70819970,"id":145944321,"diff_hunk":"@@ -1821,9 +1827,45 @@ class Writer\n             e2 = f(e2);\n             e2 = EBlock(formatBlockBody(e2));\n             writeNL();\n-            writeIndent(\"else\");\n-            writeStartStatement();\n-            result = writeExpr(e2);\n+            var elseif:Expr = null;\n+            // issue 277\n+            // if we find an EBlock([ENL(EIf(...))])\n+            // after an `else` then we have an\n+            // `else if` statement\n+            switch(e2) {\n+                case EBlock(e3):\n+                    if(e3 != null && e3.length == 1) {\n+                        switch(e3[0]) {\n+                            case ENL(e4):\n+                                switch(e4) {\n+                                    case EIf(_, _, _):\n+                                        // found single if statement after an else\n+                                        // replace parent `block` + `new line` with\n+                                        // the `if` statement instead so we stay on\n+                                        // the same line as the `else` -> `else if`\n+                                        elseif = e4;\n+                                    case EBlock(_):\n+                                        // issue 264\n+                                        // catch double-nested blocks and replace\n+                                        // outer block with inner block\n+                                        e2 = e4;\n+                                    default:\n+                                }\n+                            default:\n+                        }\n+                    }\n+                case EIf(_, _, _):\n+                    elseif = e2;\n+                default:\n+            }\n+            if(elseif != null) {\n+                writeIndent(\"else \");\n+                result = writeExpr(elseif);\n+            }else{","path":"src/as3hx/Writer.hx","position":54,"original_position":54,"commit_id":"381676594323340d40d236f761b5034dce5a1796","original_commit_id":"381676594323340d40d236f761b5034dce5a1796","user":{"login":"SlavaRa","id":1700940,"avatar_url":"https://avatars3.githubusercontent.com/u/1700940?v=4","gravatar_id":"","url":"https://api.github.com/users/SlavaRa","html_url":"https://github.com/SlavaRa","followers_url":"https://api.github.com/users/SlavaRa/followers","following_url":"https://api.github.com/users/SlavaRa/following{/other_user}","gists_url":"https://api.github.com/users/SlavaRa/gists{/gist_id}","starred_url":"https://api.github.com/users/SlavaRa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SlavaRa/subscriptions","organizations_url":"https://api.github.com/users/SlavaRa/orgs","repos_url":"https://api.github.com/users/SlavaRa/repos","events_url":"https://api.github.com/users/SlavaRa/events{/privacy}","received_events_url":"https://api.github.com/users/SlavaRa/received_events","type":"User","site_admin":false},"body":"please replace `}else{` to `} else { `","created_at":"2017-10-20T11:59:17Z","updated_at":"2017-10-20T12:03:13Z","html_url":"https://github.com/HaxeFoundation/as3hx/pull/284#discussion_r145944321","pull_request_url":"https://api.github.com/repos/HaxeFoundation/as3hx/pulls/284","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/HaxeFoundation/as3hx/pulls/comments/145944321"},"html":{"href":"https://github.com/HaxeFoundation/as3hx/pull/284#discussion_r145944321"},"pull_request":{"href":"https://api.github.com/repos/HaxeFoundation/as3hx/pulls/284"}}},"pull_request":{"url":"https://api.github.com/repos/HaxeFoundation/as3hx/pulls/284","id":147780385,"html_url":"https://github.com/HaxeFoundation/as3hx/pull/284","diff_url":"https://github.com/HaxeFoundation/as3hx/pull/284.diff","patch_url":"https://github.com/HaxeFoundation/as3hx/pull/284.patch","issue_url":"https://api.github.com/repos/HaxeFoundation/as3hx/issues/284","number":284,"state":"open","locked":false,"title":"Fixes issues #264 and #277","user":{"login":"mastef","id":762297,"avatar_url":"https://avatars0.githubusercontent.com/u/762297?v=4","gravatar_id":"","url":"https://api.github.com/users/mastef","html_url":"https://github.com/mastef","followers_url":"https://api.github.com/users/mastef/followers","following_url":"https://api.github.com/users/mastef/following{/other_user}","gists_url":"https://api.github.com/users/mastef/gists{/gist_id}","starred_url":"https://api.github.com/users/mastef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mastef/subscriptions","organizations_url":"https://api.github.com/users/mastef/orgs","repos_url":"https://api.github.com/users/mastef/repos","events_url":"https://api.github.com/users/mastef/events{/privacy}","received_events_url":"https://api.github.com/users/mastef/received_events","type":"User","site_admin":false},"body":"- keeps `else if` statements in one line\r\n- handles comments between conditional blocks\r\n- removes double-nested blocks","created_at":"2017-10-20T11:43:14Z","updated_at":"2017-10-20T12:03:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"64edc98cc560673fd149cb918a6d20d761248620","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/HaxeFoundation/as3hx/pulls/284/commits","review_comments_url":"https://api.github.com/repos/HaxeFoundation/as3hx/pulls/284/comments","review_comment_url":"https://api.github.com/repos/HaxeFoundation/as3hx/pulls/comments{/number}","comments_url":"https://api.github.com/repos/HaxeFoundation/as3hx/issues/284/comments","statuses_url":"https://api.github.com/repos/HaxeFoundation/as3hx/statuses/381676594323340d40d236f761b5034dce5a1796","head":{"label":"mastef:master","ref":"master","sha":"381676594323340d40d236f761b5034dce5a1796","user":{"login":"mastef","id":762297,"avatar_url":"https://avatars0.githubusercontent.com/u/762297?v=4","gravatar_id":"","url":"https://api.github.com/users/mastef","html_url":"https://github.com/mastef","followers_url":"https://api.github.com/users/mastef/followers","following_url":"https://api.github.com/users/mastef/following{/other_user}","gists_url":"https://api.github.com/users/mastef/gists{/gist_id}","starred_url":"https://api.github.com/users/mastef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mastef/subscriptions","organizations_url":"https://api.github.com/users/mastef/orgs","repos_url":"https://api.github.com/users/mastef/repos","events_url":"https://api.github.com/users/mastef/events{/privacy}","received_events_url":"https://api.github.com/users/mastef/received_events","type":"User","site_admin":false},"repo":{"id":107665821,"name":"as3hx","full_name":"mastef/as3hx","owner":{"login":"mastef","id":762297,"avatar_url":"https://avatars0.githubusercontent.com/u/762297?v=4","gravatar_id":"","url":"https://api.github.com/users/mastef","html_url":"https://github.com/mastef","followers_url":"https://api.github.com/users/mastef/followers","following_url":"https://api.github.com/users/mastef/following{/other_user}","gists_url":"https://api.github.com/users/mastef/gists{/gist_id}","starred_url":"https://api.github.com/users/mastef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mastef/subscriptions","organizations_url":"https://api.github.com/users/mastef/orgs","repos_url":"https://api.github.com/users/mastef/repos","events_url":"https://api.github.com/users/mastef/events{/privacy}","received_events_url":"https://api.github.com/users/mastef/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mastef/as3hx","description":"Convert AS3 sources to their Haxe equivalent","fork":true,"url":"https://api.github.com/repos/mastef/as3hx","forks_url":"https://api.github.com/repos/mastef/as3hx/forks","keys_url":"https://api.github.com/repos/mastef/as3hx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mastef/as3hx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mastef/as3hx/teams","hooks_url":"https://api.github.com/repos/mastef/as3hx/hooks","issue_events_url":"https://api.github.com/repos/mastef/as3hx/issues/events{/number}","events_url":"https://api.github.com/repos/mastef/as3hx/events","assignees_url":"https://api.github.com/repos/mastef/as3hx/assignees{/user}","branches_url":"https://api.github.com/repos/mastef/as3hx/branches{/branch}","tags_url":"https://api.github.com/repos/mastef/as3hx/tags","blobs_url":"https://api.github.com/repos/mastef/as3hx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mastef/as3hx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mastef/as3hx/git/refs{/sha}","trees_url":"https://api.github.com/repos/mastef/as3hx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mastef/as3hx/statuses/{sha}","languages_url":"https://api.github.com/repos/mastef/as3hx/languages","stargazers_url":"https://api.github.com/repos/mastef/as3hx/stargazers","contributors_url":"https://api.github.com/repos/mastef/as3hx/contributors","subscribers_url":"https://api.github.com/repos/mastef/as3hx/subscribers","subscription_url":"https://api.github.com/repos/mastef/as3hx/subscription","commits_url":"https://api.github.com/repos/mastef/as3hx/commits{/sha}","git_commits_url":"https://api.github.com/repos/mastef/as3hx/git/commits{/sha}","comments_url":"https://api.github.com/repos/mastef/as3hx/comments{/number}","issue_comment_url":"https://api.github.com/repos/mastef/as3hx/issues/comments{/number}","contents_url":"https://api.github.com/repos/mastef/as3hx/contents/{+path}","compare_url":"https://api.github.com/repos/mastef/as3hx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mastef/as3hx/merges","archive_url":"https://api.github.com/repos/mastef/as3hx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mastef/as3hx/downloads","issues_url":"https://api.github.com/repos/mastef/as3hx/issues{/number}","pulls_url":"https://api.github.com/repos/mastef/as3hx/pulls{/number}","milestones_url":"https://api.github.com/repos/mastef/as3hx/milestones{/number}","notifications_url":"https://api.github.com/repos/mastef/as3hx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mastef/as3hx/labels{/name}","releases_url":"https://api.github.com/repos/mastef/as3hx/releases{/id}","deployments_url":"https://api.github.com/repos/mastef/as3hx/deployments","created_at":"2017-10-20T10:37:09Z","updated_at":"2017-10-20T10:37:11Z","pushed_at":"2017-10-20T11:39:02Z","git_url":"git://github.com/mastef/as3hx.git","ssh_url":"git@github.com:mastef/as3hx.git","clone_url":"https://github.com/mastef/as3hx.git","svn_url":"https://github.com/mastef/as3hx","homepage":"","size":1023,"stargazers_count":0,"watchers_count":0,"language":"Haxe","has_issues":false,"has_projects":true,"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":"HaxeFoundation:master","ref":"master","sha":"b496c766d3044dbf547c0542fe9c995d168a58b6","user":{"login":"HaxeFoundation","id":3826779,"avatar_url":"https://avatars0.githubusercontent.com/u/3826779?v=4","gravatar_id":"","url":"https://api.github.com/users/HaxeFoundation","html_url":"https://github.com/HaxeFoundation","followers_url":"https://api.github.com/users/HaxeFoundation/followers","following_url":"https://api.github.com/users/HaxeFoundation/following{/other_user}","gists_url":"https://api.github.com/users/HaxeFoundation/gists{/gist_id}","starred_url":"https://api.github.com/users/HaxeFoundation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HaxeFoundation/subscriptions","organizations_url":"https://api.github.com/users/HaxeFoundation/orgs","repos_url":"https://api.github.com/users/HaxeFoundation/repos","events_url":"https://api.github.com/users/HaxeFoundation/events{/privacy}","received_events_url":"https://api.github.com/users/HaxeFoundation/received_events","type":"Organization","site_admin":false},"repo":{"id":10280139,"name":"as3hx","full_name":"HaxeFoundation/as3hx","owner":{"login":"HaxeFoundation","id":3826779,"avatar_url":"https://avatars0.githubusercontent.com/u/3826779?v=4","gravatar_id":"","url":"https://api.github.com/users/HaxeFoundation","html_url":"https://github.com/HaxeFoundation","followers_url":"https://api.github.com/users/HaxeFoundation/followers","following_url":"https://api.github.com/users/HaxeFoundation/following{/other_user}","gists_url":"https://api.github.com/users/HaxeFoundation/gists{/gist_id}","starred_url":"https://api.github.com/users/HaxeFoundation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HaxeFoundation/subscriptions","organizations_url":"https://api.github.com/users/HaxeFoundation/orgs","repos_url":"https://api.github.com/users/HaxeFoundation/repos","events_url":"https://api.github.com/users/HaxeFoundation/events{/privacy}","received_events_url":"https://api.github.com/users/HaxeFoundation/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/HaxeFoundation/as3hx","description":"Convert AS3 sources to their Haxe equivalent","fork":false,"url":"https://api.github.com/repos/HaxeFoundation/as3hx","forks_url":"https://api.github.com/repos/HaxeFoundation/as3hx/forks","keys_url":"https://api.github.com/repos/HaxeFoundation/as3hx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/HaxeFoundation/as3hx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/HaxeFoundation/as3hx/teams","hooks_url":"https://api.github.com/repos/HaxeFoundation/as3hx/hooks","issue_events_url":"https://api.github.com/repos/HaxeFoundation/as3hx/issues/events{/number}","events_url":"https://api.github.com/repos/HaxeFoundation/as3hx/events","assignees_url":"https://api.github.com/repos/HaxeFoundation/as3hx/assignees{/user}","branches_url":"https://api.github.com/repos/HaxeFoundation/as3hx/branches{/branch}","tags_url":"https://api.github.com/repos/HaxeFoundation/as3hx/tags","blobs_url":"https://api.github.com/repos/HaxeFoundation/as3hx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/HaxeFoundation/as3hx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/HaxeFoundation/as3hx/git/refs{/sha}","trees_url":"https://api.github.com/repos/HaxeFoundation/as3hx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/HaxeFoundation/as3hx/statuses/{sha}","languages_url":"https://api.github.com/repos/HaxeFoundation/as3hx/languages","stargazers_url":"https://api.github.com/repos/HaxeFoundation/as3hx/stargazers","contributors_url":"https://api.github.com/repos/HaxeFoundation/as3hx/contributors","subscribers_url":"https://api.github.com/repos/HaxeFoundation/as3hx/subscribers","subscription_url":"https://api.github.com/repos/HaxeFoundation/as3hx/subscription","commits_url":"https://api.github.com/repos/HaxeFoundation/as3hx/commits{/sha}","git_commits_url":"https://api.github.com/repos/HaxeFoundation/as3hx/git/commits{/sha}","comments_url":"https://api.github.com/repos/HaxeFoundation/as3hx/comments{/number}","issue_comment_url":"https://api.github.com/repos/HaxeFoundation/as3hx/issues/comments{/number}","contents_url":"https://api.github.com/repos/HaxeFoundation/as3hx/contents/{+path}","compare_url":"https://api.github.com/repos/HaxeFoundation/as3hx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/HaxeFoundation/as3hx/merges","archive_url":"https://api.github.com/repos/HaxeFoundation/as3hx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/HaxeFoundation/as3hx/downloads","issues_url":"https://api.github.com/repos/HaxeFoundation/as3hx/issues{/number}","pulls_url":"https://api.github.com/repos/HaxeFoundation/as3hx/pulls{/number}","milestones_url":"https://api.github.com/repos/HaxeFoundation/as3hx/milestones{/number}","notifications_url":"https://api.github.com/repos/HaxeFoundation/as3hx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/HaxeFoundation/as3hx/labels{/name}","releases_url":"https://api.github.com/repos/HaxeFoundation/as3hx/releases{/id}","deployments_url":"https://api.github.com/repos/HaxeFoundation/as3hx/deployments","created_at":"2013-05-25T05:39:53Z","updated_at":"2017-10-13T05:42:34Z","pushed_at":"2017-10-20T11:43:15Z","git_url":"git://github.com/HaxeFoundation/as3hx.git","ssh_url":"git@github.com:HaxeFoundation/as3hx.git","clone_url":"https://github.com/HaxeFoundation/as3hx.git","svn_url":"https://github.com/HaxeFoundation/as3hx","homepage":"","size":1027,"stargazers_count":108,"watchers_count":108,"language":"Haxe","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":36,"mirror_url":null,"open_issues_count":44,"forks":36,"open_issues":44,"watchers":108,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/HaxeFoundation/as3hx/pulls/284"},"html":{"href":"https://github.com/HaxeFoundation/as3hx/pull/284"},"issue":{"href":"https://api.github.com/repos/HaxeFoundation/as3hx/issues/284"},"comments":{"href":"https://api.github.com/repos/HaxeFoundation/as3hx/issues/284/comments"},"review_comments":{"href":"https://api.github.com/repos/HaxeFoundation/as3hx/pulls/284/comments"},"review_comment":{"href":"https://api.github.com/repos/HaxeFoundation/as3hx/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/HaxeFoundation/as3hx/pulls/284/commits"},"statuses":{"href":"https://api.github.com/repos/HaxeFoundation/as3hx/statuses/381676594323340d40d236f761b5034dce5a1796"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"SlavaRa"}}