{"action":"created","comment":{"url":"https://api.github.com/repos/code-squad/javascript-json/pulls/comments/228018629","pull_request_review_id":168189663,"id":228018629,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyODAxODYyOQ==","diff_hunk":"@@ -0,0 +1,72 @@\n+module.exports = function lexer(tokens) {\n+    const lexemes = [];\n+\n+    for (let token of tokens) {\n+        lexemes.push(new Lexeme(token));\n+    }\n+\n+    return lexemes;\n+}\n+\n+class Lexeme {\n+    constructor(token) {\n+        this.type = this.getType(token);\n+        this.value = this.getValue(this.type, token);\n+    }\n+\n+    getType(token) {\n+        const typeCheck = new TypeCheck;\n+        const error = new Error;\n+\n+        if (typeCheck.isNull(token)) return 'null';","path":"lexer.js","position":21,"original_position":21,"commit_id":"66c01f07745505edbe7da183e99bfddaa7fde302","original_commit_id":"66c01f07745505edbe7da183e99bfddaa7fde302","user":{"login":"nigayo","id":1456761,"node_id":"MDQ6VXNlcjE0NTY3NjE=","avatar_url":"https://avatars2.githubusercontent.com/u/1456761?v=4","gravatar_id":"","url":"https://api.github.com/users/nigayo","html_url":"https://github.com/nigayo","followers_url":"https://api.github.com/users/nigayo/followers","following_url":"https://api.github.com/users/nigayo/following{/other_user}","gists_url":"https://api.github.com/users/nigayo/gists{/gist_id}","starred_url":"https://api.github.com/users/nigayo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nigayo/subscriptions","organizations_url":"https://api.github.com/users/nigayo/orgs","repos_url":"https://api.github.com/users/nigayo/repos","events_url":"https://api.github.com/users/nigayo/events{/privacy}","received_events_url":"https://api.github.com/users/nigayo/received_events","type":"User","site_admin":false},"body":"많이 나오는 유형을  if문 앞에 두는게 효율적이겠죠.\r\n그런점에서 null체크는 좀 뒤로 미는게 좋겠네요.","created_at":"2018-10-25T02:39:50Z","updated_at":"2018-10-25T02:45:53Z","html_url":"https://github.com/code-squad/javascript-json/pull/91#discussion_r228018629","pull_request_url":"https://api.github.com/repos/code-squad/javascript-json/pulls/91","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/code-squad/javascript-json/pulls/comments/228018629"},"html":{"href":"https://github.com/code-squad/javascript-json/pull/91#discussion_r228018629"},"pull_request":{"href":"https://api.github.com/repos/code-squad/javascript-json/pulls/91"}}},"pull_request":{"url":"https://api.github.com/repos/code-squad/javascript-json/pulls/91","id":225402529,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI1NDAyNTI5","html_url":"https://github.com/code-squad/javascript-json/pull/91","diff_url":"https://github.com/code-squad/javascript-json/pull/91.diff","patch_url":"https://github.com/code-squad/javascript-json/pull/91.patch","issue_url":"https://api.github.com/repos/code-squad/javascript-json/issues/91","number":91,"state":"open","locked":false,"title":"[Torco] Step4 - 여러 Type 지원","user":{"login":"cohily12","id":25479538,"node_id":"MDQ6VXNlcjI1NDc5NTM4","avatar_url":"https://avatars1.githubusercontent.com/u/25479538?v=4","gravatar_id":"","url":"https://api.github.com/users/cohily12","html_url":"https://github.com/cohily12","followers_url":"https://api.github.com/users/cohily12/followers","following_url":"https://api.github.com/users/cohily12/following{/other_user}","gists_url":"https://api.github.com/users/cohily12/gists{/gist_id}","starred_url":"https://api.github.com/users/cohily12/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cohily12/subscriptions","organizations_url":"https://api.github.com/users/cohily12/orgs","repos_url":"https://api.github.com/users/cohily12/repos","events_url":"https://api.github.com/users/cohily12/events{/privacy}","received_events_url":"https://api.github.com/users/cohily12/received_events","type":"User","site_admin":false},"body":"- module 화하여 step4를 진행해보았습니다.\r\n1. class Stack은 push, pop, peek 메소드만 두어 다른 곳에서도 쓸 수 있는 구조로 바꾸어 재 사용성을 높였습니다.\r\n2. tokenizer은 인자로 받은 문자열을 나누는 역할, lexer는 나눠진 문자열을 type과 value를 부여하는 역할, parser는 lexer 모듈의 반환값을 통해 데이터 구조를 구축하는 역할로 나눠 독립성을 키웠습니다.\r\n​\r\n궁금한 점?\r\n1. lexeme class에서 getType, getValue 메소드의 모양이 비슷한 거 같은데 합치는 게 좋을까요?\r\n2. tokenizer에서 문자열을 나누는 기준이 실제로는 어떻게 되는지?\r\n3. type 지원 범위가 확장되면서 if 구문이 늘어 가독성이 저해되는 건 아닌지?\r\n","created_at":"2018-10-24T13:26:19Z","updated_at":"2018-10-25T02:45:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"90d6664932e47626038100f78d02549fde7353fe","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/code-squad/javascript-json/pulls/91/commits","review_comments_url":"https://api.github.com/repos/code-squad/javascript-json/pulls/91/comments","review_comment_url":"https://api.github.com/repos/code-squad/javascript-json/pulls/comments{/number}","comments_url":"https://api.github.com/repos/code-squad/javascript-json/issues/91/comments","statuses_url":"https://api.github.com/repos/code-squad/javascript-json/statuses/66c01f07745505edbe7da183e99bfddaa7fde302","head":{"label":"cohily12:step4","ref":"step4","sha":"66c01f07745505edbe7da183e99bfddaa7fde302","user":{"login":"cohily12","id":25479538,"node_id":"MDQ6VXNlcjI1NDc5NTM4","avatar_url":"https://avatars1.githubusercontent.com/u/25479538?v=4","gravatar_id":"","url":"https://api.github.com/users/cohily12","html_url":"https://github.com/cohily12","followers_url":"https://api.github.com/users/cohily12/followers","following_url":"https://api.github.com/users/cohily12/following{/other_user}","gists_url":"https://api.github.com/users/cohily12/gists{/gist_id}","starred_url":"https://api.github.com/users/cohily12/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cohily12/subscriptions","organizations_url":"https://api.github.com/users/cohily12/orgs","repos_url":"https://api.github.com/users/cohily12/repos","events_url":"https://api.github.com/users/cohily12/events{/privacy}","received_events_url":"https://api.github.com/users/cohily12/received_events","type":"User","site_admin":false},"repo":{"id":152509063,"node_id":"MDEwOlJlcG9zaXRvcnkxNTI1MDkwNjM=","name":"javascript-json","full_name":"cohily12/javascript-json","private":false,"owner":{"login":"cohily12","id":25479538,"node_id":"MDQ6VXNlcjI1NDc5NTM4","avatar_url":"https://avatars1.githubusercontent.com/u/25479538?v=4","gravatar_id":"","url":"https://api.github.com/users/cohily12","html_url":"https://github.com/cohily12","followers_url":"https://api.github.com/users/cohily12/followers","following_url":"https://api.github.com/users/cohily12/following{/other_user}","gists_url":"https://api.github.com/users/cohily12/gists{/gist_id}","starred_url":"https://api.github.com/users/cohily12/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cohily12/subscriptions","organizations_url":"https://api.github.com/users/cohily12/orgs","repos_url":"https://api.github.com/users/cohily12/repos","events_url":"https://api.github.com/users/cohily12/events{/privacy}","received_events_url":"https://api.github.com/users/cohily12/received_events","type":"User","site_admin":false},"html_url":"https://github.com/cohily12/javascript-json","description":"레벨2","fork":true,"url":"https://api.github.com/repos/cohily12/javascript-json","forks_url":"https://api.github.com/repos/cohily12/javascript-json/forks","keys_url":"https://api.github.com/repos/cohily12/javascript-json/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cohily12/javascript-json/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cohily12/javascript-json/teams","hooks_url":"https://api.github.com/repos/cohily12/javascript-json/hooks","issue_events_url":"https://api.github.com/repos/cohily12/javascript-json/issues/events{/number}","events_url":"https://api.github.com/repos/cohily12/javascript-json/events","assignees_url":"https://api.github.com/repos/cohily12/javascript-json/assignees{/user}","branches_url":"https://api.github.com/repos/cohily12/javascript-json/branches{/branch}","tags_url":"https://api.github.com/repos/cohily12/javascript-json/tags","blobs_url":"https://api.github.com/repos/cohily12/javascript-json/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cohily12/javascript-json/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cohily12/javascript-json/git/refs{/sha}","trees_url":"https://api.github.com/repos/cohily12/javascript-json/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cohily12/javascript-json/statuses/{sha}","languages_url":"https://api.github.com/repos/cohily12/javascript-json/languages","stargazers_url":"https://api.github.com/repos/cohily12/javascript-json/stargazers","contributors_url":"https://api.github.com/repos/cohily12/javascript-json/contributors","subscribers_url":"https://api.github.com/repos/cohily12/javascript-json/subscribers","subscription_url":"https://api.github.com/repos/cohily12/javascript-json/subscription","commits_url":"https://api.github.com/repos/cohily12/javascript-json/commits{/sha}","git_commits_url":"https://api.github.com/repos/cohily12/javascript-json/git/commits{/sha}","comments_url":"https://api.github.com/repos/cohily12/javascript-json/comments{/number}","issue_comment_url":"https://api.github.com/repos/cohily12/javascript-json/issues/comments{/number}","contents_url":"https://api.github.com/repos/cohily12/javascript-json/contents/{+path}","compare_url":"https://api.github.com/repos/cohily12/javascript-json/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cohily12/javascript-json/merges","archive_url":"https://api.github.com/repos/cohily12/javascript-json/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cohily12/javascript-json/downloads","issues_url":"https://api.github.com/repos/cohily12/javascript-json/issues{/number}","pulls_url":"https://api.github.com/repos/cohily12/javascript-json/pulls{/number}","milestones_url":"https://api.github.com/repos/cohily12/javascript-json/milestones{/number}","notifications_url":"https://api.github.com/repos/cohily12/javascript-json/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cohily12/javascript-json/labels{/name}","releases_url":"https://api.github.com/repos/cohily12/javascript-json/releases{/id}","deployments_url":"https://api.github.com/repos/cohily12/javascript-json/deployments","created_at":"2018-10-11T00:51:54Z","updated_at":"2018-10-11T00:51:56Z","pushed_at":"2018-10-24T13:24:29Z","git_url":"git://github.com/cohily12/javascript-json.git","ssh_url":"git@github.com:cohily12/javascript-json.git","clone_url":"https://github.com/cohily12/javascript-json.git","svn_url":"https://github.com/cohily12/javascript-json","homepage":null,"size":6510,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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:cohily12","ref":"cohily12","sha":"45cd24dd80db32726a8f0e1ccb4c024429091fd3","user":{"login":"code-squad","id":22832280,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyODMyMjgw","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":107010155,"node_id":"MDEwOlJlcG9zaXRvcnkxMDcwMTAxNTU=","name":"javascript-json","full_name":"code-squad/javascript-json","private":false,"owner":{"login":"code-squad","id":22832280,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIyODMyMjgw","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},"html_url":"https://github.com/code-squad/javascript-json","description":"레벨2","fork":false,"url":"https://api.github.com/repos/code-squad/javascript-json","forks_url":"https://api.github.com/repos/code-squad/javascript-json/forks","keys_url":"https://api.github.com/repos/code-squad/javascript-json/keys{/key_id}","collaborators_url":"https://api.github.com/repos/code-squad/javascript-json/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/code-squad/javascript-json/teams","hooks_url":"https://api.github.com/repos/code-squad/javascript-json/hooks","issue_events_url":"https://api.github.com/repos/code-squad/javascript-json/issues/events{/number}","events_url":"https://api.github.com/repos/code-squad/javascript-json/events","assignees_url":"https://api.github.com/repos/code-squad/javascript-json/assignees{/user}","branches_url":"https://api.github.com/repos/code-squad/javascript-json/branches{/branch}","tags_url":"https://api.github.com/repos/code-squad/javascript-json/tags","blobs_url":"https://api.github.com/repos/code-squad/javascript-json/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/code-squad/javascript-json/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/code-squad/javascript-json/git/refs{/sha}","trees_url":"https://api.github.com/repos/code-squad/javascript-json/git/trees{/sha}","statuses_url":"https://api.github.com/repos/code-squad/javascript-json/statuses/{sha}","languages_url":"https://api.github.com/repos/code-squad/javascript-json/languages","stargazers_url":"https://api.github.com/repos/code-squad/javascript-json/stargazers","contributors_url":"https://api.github.com/repos/code-squad/javascript-json/contributors","subscribers_url":"https://api.github.com/repos/code-squad/javascript-json/subscribers","subscription_url":"https://api.github.com/repos/code-squad/javascript-json/subscription","commits_url":"https://api.github.com/repos/code-squad/javascript-json/commits{/sha}","git_commits_url":"https://api.github.com/repos/code-squad/javascript-json/git/commits{/sha}","comments_url":"https://api.github.com/repos/code-squad/javascript-json/comments{/number}","issue_comment_url":"https://api.github.com/repos/code-squad/javascript-json/issues/comments{/number}","contents_url":"https://api.github.com/repos/code-squad/javascript-json/contents/{+path}","compare_url":"https://api.github.com/repos/code-squad/javascript-json/compare/{base}...{head}","merges_url":"https://api.github.com/repos/code-squad/javascript-json/merges","archive_url":"https://api.github.com/repos/code-squad/javascript-json/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/code-squad/javascript-json/downloads","issues_url":"https://api.github.com/repos/code-squad/javascript-json/issues{/number}","pulls_url":"https://api.github.com/repos/code-squad/javascript-json/pulls{/number}","milestones_url":"https://api.github.com/repos/code-squad/javascript-json/milestones{/number}","notifications_url":"https://api.github.com/repos/code-squad/javascript-json/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/code-squad/javascript-json/labels{/name}","releases_url":"https://api.github.com/repos/code-squad/javascript-json/releases{/id}","deployments_url":"https://api.github.com/repos/code-squad/javascript-json/deployments","created_at":"2017-10-15T12:28:38Z","updated_at":"2018-03-13T05:43:41Z","pushed_at":"2018-10-24T13:26:20Z","git_url":"git://github.com/code-squad/javascript-json.git","ssh_url":"git@github.com:code-squad/javascript-json.git","clone_url":"https://github.com/code-squad/javascript-json.git","svn_url":"https://github.com/code-squad/javascript-json","homepage":null,"size":6511,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":19,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":19,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/code-squad/javascript-json/pulls/91"},"html":{"href":"https://github.com/code-squad/javascript-json/pull/91"},"issue":{"href":"https://api.github.com/repos/code-squad/javascript-json/issues/91"},"comments":{"href":"https://api.github.com/repos/code-squad/javascript-json/issues/91/comments"},"review_comments":{"href":"https://api.github.com/repos/code-squad/javascript-json/pulls/91/comments"},"review_comment":{"href":"https://api.github.com/repos/code-squad/javascript-json/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/code-squad/javascript-json/pulls/91/commits"},"statuses":{"href":"https://api.github.com/repos/code-squad/javascript-json/statuses/66c01f07745505edbe7da183e99bfddaa7fde302"}},"author_association":"NONE"}}
{"actor":{"display_login":"nigayo"}}