{"action":"created","comment":{"url":"https://api.github.com/repos/code-squad/swift-jsonparser/pulls/comments/180953142","pull_request_review_id":111464265,"id":180953142,"diff_hunk":"@@ -11,42 +11,124 @@ import Foundation\n struct MyJsonParser {\n     \n     func checkBrackets(_ input: String) -> JSONData? {\n-        let grammarChecker = GrammarChecker.init(input)\n+        let grammarChecker = GrammarChecker()\n+        guard grammarChecker.isValidFirstString(input) && grammarChecker.isValidLastString(input) else {\n+            print(\"지원하지 않는 형식을 포함하고 있습니다.\")\n+            return nil }\n         if input.hasPrefix(\"{\") {\n-            let data = separateByComma(input)\n-            let removeBracketsData = removeBrackets(data)\n+            let removeWhiteSpaceData = removeWhiteSpace(input)\n+            let jsonData = checkColonAndBrackets(removeWhiteSpaceData)\n+            return jsonData\n+        } else if input.hasPrefix(\"[\") {\n+            let removeWhiteSpaceData = removeWhiteSpace(input)\n+            let dropBracketsData = dropBrackets(removeWhiteSpaceData)\n+            let arrayCount = countOfArrayData(dropBracketsData)\n+            let objectCount = countOfObjectData(dropBracketsData)\n+            let jsonData = ArrayData.init(array: arrayCount, object: objectCount)\n+            return jsonData\n+        }\n+        return nil\n+    }\n+    \n+    /* inputValue start [ */\n+    //시작과 끝 괄호 [] drop\n+    func dropBrackets(_ inputString: String) -> String {\n+        let dropFirst = inputString.dropFirst()\n+        let dropLast = dropFirst.dropLast()\n+        return String(dropLast)\n+    }\n+    \n+    //배열 카운트\n+    func countOfArrayData(_ input: String) -> Int {","path":"JSONParser/JSONParser/MyJsonParser.swift","position":35,"original_position":35,"commit_id":"0ff0e792327c0ede29a142bc6d3aa773aacfd758","original_commit_id":"0ff0e792327c0ede29a142bc6d3aa773aacfd758","user":{"login":"godrm","id":278988,"avatar_url":"https://avatars1.githubusercontent.com/u/278988?v=4","gravatar_id":"","url":"https://api.github.com/users/godrm","html_url":"https://github.com/godrm","followers_url":"https://api.github.com/users/godrm/followers","following_url":"https://api.github.com/users/godrm/following{/other_user}","gists_url":"https://api.github.com/users/godrm/gists{/gist_id}","starred_url":"https://api.github.com/users/godrm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/godrm/subscriptions","organizations_url":"https://api.github.com/users/godrm/orgs","repos_url":"https://api.github.com/users/godrm/repos","events_url":"https://api.github.com/users/godrm/events{/privacy}","received_events_url":"https://api.github.com/users/godrm/received_events","type":"User","site_admin":false},"body":"내부에서만 쓰는 함수가 있다면  private으로 처리하세요.","created_at":"2018-04-12T02:59:28Z","updated_at":"2018-04-12T03:00:07Z","html_url":"https://github.com/code-squad/swift-jsonparser/pull/59#discussion_r180953142","pull_request_url":"https://api.github.com/repos/code-squad/swift-jsonparser/pulls/59","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/code-squad/swift-jsonparser/pulls/comments/180953142"},"html":{"href":"https://github.com/code-squad/swift-jsonparser/pull/59#discussion_r180953142"},"pull_request":{"href":"https://api.github.com/repos/code-squad/swift-jsonparser/pulls/59"}}},"pull_request":{"url":"https://api.github.com/repos/code-squad/swift-jsonparser/pulls/59","id":180821760,"html_url":"https://github.com/code-squad/swift-jsonparser/pull/59","diff_url":"https://github.com/code-squad/swift-jsonparser/pull/59.diff","patch_url":"https://github.com/code-squad/swift-jsonparser/pull/59.patch","issue_url":"https://api.github.com/repos/code-squad/swift-jsonparser/issues/59","number":59,"state":"open","locked":false,"title":"[hyun] 중첩된 배열과 객체 분석하는 코드 구현","user":{"login":"cocomilktea","id":31604961,"avatar_url":"https://avatars3.githubusercontent.com/u/31604961?v=4","gravatar_id":"","url":"https://api.github.com/users/cocomilktea","html_url":"https://github.com/cocomilktea","followers_url":"https://api.github.com/users/cocomilktea/followers","following_url":"https://api.github.com/users/cocomilktea/following{/other_user}","gists_url":"https://api.github.com/users/cocomilktea/gists{/gist_id}","starred_url":"https://api.github.com/users/cocomilktea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cocomilktea/subscriptions","organizations_url":"https://api.github.com/users/cocomilktea/orgs","repos_url":"https://api.github.com/users/cocomilktea/repos","events_url":"https://api.github.com/users/cocomilktea/events{/privacy}","received_events_url":"https://api.github.com/users/cocomilktea/received_events","type":"User","site_admin":false},"body":"JSON step4 PR 보냅니다 :) ","created_at":"2018-04-11T08:12:29Z","updated_at":"2018-04-12T03:00:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c97aaf97e4f55eeb087a85fe75772121152011d9","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/code-squad/swift-jsonparser/pulls/59/commits","review_comments_url":"https://api.github.com/repos/code-squad/swift-jsonparser/pulls/59/comments","review_comment_url":"https://api.github.com/repos/code-squad/swift-jsonparser/pulls/comments{/number}","comments_url":"https://api.github.com/repos/code-squad/swift-jsonparser/issues/59/comments","statuses_url":"https://api.github.com/repos/code-squad/swift-jsonparser/statuses/0ff0e792327c0ede29a142bc6d3aa773aacfd758","head":{"label":"cocomilktea:jsonparser-step4","ref":"jsonparser-step4","sha":"0ff0e792327c0ede29a142bc6d3aa773aacfd758","user":{"login":"cocomilktea","id":31604961,"avatar_url":"https://avatars3.githubusercontent.com/u/31604961?v=4","gravatar_id":"","url":"https://api.github.com/users/cocomilktea","html_url":"https://github.com/cocomilktea","followers_url":"https://api.github.com/users/cocomilktea/followers","following_url":"https://api.github.com/users/cocomilktea/following{/other_user}","gists_url":"https://api.github.com/users/cocomilktea/gists{/gist_id}","starred_url":"https://api.github.com/users/cocomilktea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cocomilktea/subscriptions","organizations_url":"https://api.github.com/users/cocomilktea/orgs","repos_url":"https://api.github.com/users/cocomilktea/repos","events_url":"https://api.github.com/users/cocomilktea/events{/privacy}","received_events_url":"https://api.github.com/users/cocomilktea/received_events","type":"User","site_admin":false},"repo":{"id":124820078,"name":"swift-jsonparser","full_name":"cocomilktea/swift-jsonparser","owner":{"login":"cocomilktea","id":31604961,"avatar_url":"https://avatars3.githubusercontent.com/u/31604961?v=4","gravatar_id":"","url":"https://api.github.com/users/cocomilktea","html_url":"https://github.com/cocomilktea","followers_url":"https://api.github.com/users/cocomilktea/followers","following_url":"https://api.github.com/users/cocomilktea/following{/other_user}","gists_url":"https://api.github.com/users/cocomilktea/gists{/gist_id}","starred_url":"https://api.github.com/users/cocomilktea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cocomilktea/subscriptions","organizations_url":"https://api.github.com/users/cocomilktea/orgs","repos_url":"https://api.github.com/users/cocomilktea/repos","events_url":"https://api.github.com/users/cocomilktea/events{/privacy}","received_events_url":"https://api.github.com/users/cocomilktea/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cocomilktea/swift-jsonparser","description":"JSON문자열 분석기 저장소","fork":true,"url":"https://api.github.com/repos/cocomilktea/swift-jsonparser","forks_url":"https://api.github.com/repos/cocomilktea/swift-jsonparser/forks","keys_url":"https://api.github.com/repos/cocomilktea/swift-jsonparser/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cocomilktea/swift-jsonparser/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cocomilktea/swift-jsonparser/teams","hooks_url":"https://api.github.com/repos/cocomilktea/swift-jsonparser/hooks","issue_events_url":"https://api.github.com/repos/cocomilktea/swift-jsonparser/issues/events{/number}","events_url":"https://api.github.com/repos/cocomilktea/swift-jsonparser/events","assignees_url":"https://api.github.com/repos/cocomilktea/swift-jsonparser/assignees{/user}","branches_url":"https://api.github.com/repos/cocomilktea/swift-jsonparser/branches{/branch}","tags_url":"https://api.github.com/repos/cocomilktea/swift-jsonparser/tags","blobs_url":"https://api.github.com/repos/cocomilktea/swift-jsonparser/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cocomilktea/swift-jsonparser/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cocomilktea/swift-jsonparser/git/refs{/sha}","trees_url":"https://api.github.com/repos/cocomilktea/swift-jsonparser/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cocomilktea/swift-jsonparser/statuses/{sha}","languages_url":"https://api.github.com/repos/cocomilktea/swift-jsonparser/languages","stargazers_url":"https://api.github.com/repos/cocomilktea/swift-jsonparser/stargazers","contributors_url":"https://api.github.com/repos/cocomilktea/swift-jsonparser/contributors","subscribers_url":"https://api.github.com/repos/cocomilktea/swift-jsonparser/subscribers","subscription_url":"https://api.github.com/repos/cocomilktea/swift-jsonparser/subscription","commits_url":"https://api.github.com/repos/cocomilktea/swift-jsonparser/commits{/sha}","git_commits_url":"https://api.github.com/repos/cocomilktea/swift-jsonparser/git/commits{/sha}","comments_url":"https://api.github.com/repos/cocomilktea/swift-jsonparser/comments{/number}","issue_comment_url":"https://api.github.com/repos/cocomilktea/swift-jsonparser/issues/comments{/number}","contents_url":"https://api.github.com/repos/cocomilktea/swift-jsonparser/contents/{+path}","compare_url":"https://api.github.com/repos/cocomilktea/swift-jsonparser/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cocomilktea/swift-jsonparser/merges","archive_url":"https://api.github.com/repos/cocomilktea/swift-jsonparser/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cocomilktea/swift-jsonparser/downloads","issues_url":"https://api.github.com/repos/cocomilktea/swift-jsonparser/issues{/number}","pulls_url":"https://api.github.com/repos/cocomilktea/swift-jsonparser/pulls{/number}","milestones_url":"https://api.github.com/repos/cocomilktea/swift-jsonparser/milestones{/number}","notifications_url":"https://api.github.com/repos/cocomilktea/swift-jsonparser/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cocomilktea/swift-jsonparser/labels{/name}","releases_url":"https://api.github.com/repos/cocomilktea/swift-jsonparser/releases{/id}","deployments_url":"https://api.github.com/repos/cocomilktea/swift-jsonparser/deployments","created_at":"2018-03-12T02:00:21Z","updated_at":"2018-03-12T02:00:22Z","pushed_at":"2018-04-11T08:11:08Z","git_url":"git://github.com/cocomilktea/swift-jsonparser.git","ssh_url":"git@github.com:cocomilktea/swift-jsonparser.git","clone_url":"https://github.com/cocomilktea/swift-jsonparser.git","svn_url":"https://github.com/cocomilktea/swift-jsonparser","homepage":null,"size":734,"stargazers_count":0,"watchers_count":0,"language":"Swift","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"code-squad:cocomilktea","ref":"cocomilktea","sha":"1e6dbbfcc82ede7caeb453a662629e538ccb1f2d","user":{"login":"code-squad","id":22832280,"avatar_url":"https://avatars2.githubusercontent.com/u/22832280?v=4","gravatar_id":"","url":"https://api.github.com/users/code-squad","html_url":"https://github.com/code-squad","followers_url":"https://api.github.com/users/code-squad/followers","following_url":"https://api.github.com/users/code-squad/following{/other_user}","gists_url":"https://api.github.com/users/code-squad/gists{/gist_id}","starred_url":"https://api.github.com/users/code-squad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/code-squad/subscriptions","organizations_url":"https://api.github.com/users/code-squad/orgs","repos_url":"https://api.github.com/users/code-squad/repos","events_url":"https://api.github.com/users/code-squad/events{/privacy}","received_events_url":"https://api.github.com/users/code-squad/received_events","type":"Organization","site_admin":false},"repo":{"id":106374447,"name":"swift-jsonparser","full_name":"code-squad/swift-jsonparser","owner":{"login":"code-squad","id":22832280,"avatar_url":"https://avatars2.githubusercontent.com/u/22832280?v=4","gravatar_id":"","url":"https://api.github.com/users/code-squad","html_url":"https://github.com/code-squad","followers_url":"https://api.github.com/users/code-squad/followers","following_url":"https://api.github.com/users/code-squad/following{/other_user}","gists_url":"https://api.github.com/users/code-squad/gists{/gist_id}","starred_url":"https://api.github.com/users/code-squad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/code-squad/subscriptions","organizations_url":"https://api.github.com/users/code-squad/orgs","repos_url":"https://api.github.com/users/code-squad/repos","events_url":"https://api.github.com/users/code-squad/events{/privacy}","received_events_url":"https://api.github.com/users/code-squad/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/code-squad/swift-jsonparser","description":"JSON문자열 분석기 저장소","fork":false,"url":"https://api.github.com/repos/code-squad/swift-jsonparser","forks_url":"https://api.github.com/repos/code-squad/swift-jsonparser/forks","keys_url":"https://api.github.com/repos/code-squad/swift-jsonparser/keys{/key_id}","collaborators_url":"https://api.github.com/repos/code-squad/swift-jsonparser/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/code-squad/swift-jsonparser/teams","hooks_url":"https://api.github.com/repos/code-squad/swift-jsonparser/hooks","issue_events_url":"https://api.github.com/repos/code-squad/swift-jsonparser/issues/events{/number}","events_url":"https://api.github.com/repos/code-squad/swift-jsonparser/events","assignees_url":"https://api.github.com/repos/code-squad/swift-jsonparser/assignees{/user}","branches_url":"https://api.github.com/repos/code-squad/swift-jsonparser/branches{/branch}","tags_url":"https://api.github.com/repos/code-squad/swift-jsonparser/tags","blobs_url":"https://api.github.com/repos/code-squad/swift-jsonparser/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/code-squad/swift-jsonparser/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/code-squad/swift-jsonparser/git/refs{/sha}","trees_url":"https://api.github.com/repos/code-squad/swift-jsonparser/git/trees{/sha}","statuses_url":"https://api.github.com/repos/code-squad/swift-jsonparser/statuses/{sha}","languages_url":"https://api.github.com/repos/code-squad/swift-jsonparser/languages","stargazers_url":"https://api.github.com/repos/code-squad/swift-jsonparser/stargazers","contributors_url":"https://api.github.com/repos/code-squad/swift-jsonparser/contributors","subscribers_url":"https://api.github.com/repos/code-squad/swift-jsonparser/subscribers","subscription_url":"https://api.github.com/repos/code-squad/swift-jsonparser/subscription","commits_url":"https://api.github.com/repos/code-squad/swift-jsonparser/commits{/sha}","git_commits_url":"https://api.github.com/repos/code-squad/swift-jsonparser/git/commits{/sha}","comments_url":"https://api.github.com/repos/code-squad/swift-jsonparser/comments{/number}","issue_comment_url":"https://api.github.com/repos/code-squad/swift-jsonparser/issues/comments{/number}","contents_url":"https://api.github.com/repos/code-squad/swift-jsonparser/contents/{+path}","compare_url":"https://api.github.com/repos/code-squad/swift-jsonparser/compare/{base}...{head}","merges_url":"https://api.github.com/repos/code-squad/swift-jsonparser/merges","archive_url":"https://api.github.com/repos/code-squad/swift-jsonparser/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/code-squad/swift-jsonparser/downloads","issues_url":"https://api.github.com/repos/code-squad/swift-jsonparser/issues{/number}","pulls_url":"https://api.github.com/repos/code-squad/swift-jsonparser/pulls{/number}","milestones_url":"https://api.github.com/repos/code-squad/swift-jsonparser/milestones{/number}","notifications_url":"https://api.github.com/repos/code-squad/swift-jsonparser/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/code-squad/swift-jsonparser/labels{/name}","releases_url":"https://api.github.com/repos/code-squad/swift-jsonparser/releases{/id}","deployments_url":"https://api.github.com/repos/code-squad/swift-jsonparser/deployments","created_at":"2017-10-10T06:00:00Z","updated_at":"2017-12-19T14:37:17Z","pushed_at":"2018-04-11T08:12:30Z","git_url":"git://github.com/code-squad/swift-jsonparser.git","ssh_url":"git@github.com:code-squad/swift-jsonparser.git","clone_url":"https://github.com/code-squad/swift-jsonparser.git","svn_url":"https://github.com/code-squad/swift-jsonparser","homepage":null,"size":757,"stargazers_count":1,"watchers_count":1,"language":"Swift","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":11,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/code-squad/swift-jsonparser/pulls/59"},"html":{"href":"https://github.com/code-squad/swift-jsonparser/pull/59"},"issue":{"href":"https://api.github.com/repos/code-squad/swift-jsonparser/issues/59"},"comments":{"href":"https://api.github.com/repos/code-squad/swift-jsonparser/issues/59/comments"},"review_comments":{"href":"https://api.github.com/repos/code-squad/swift-jsonparser/pulls/59/comments"},"review_comment":{"href":"https://api.github.com/repos/code-squad/swift-jsonparser/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/code-squad/swift-jsonparser/pulls/59/commits"},"statuses":{"href":"https://api.github.com/repos/code-squad/swift-jsonparser/statuses/0ff0e792327c0ede29a142bc6d3aa773aacfd758"}},"author_association":"NONE"}}
{"actor":{"display_login":"godrm"}}