{"action":"created","comment":{"url":"https://api.github.com/repos/janyou/Antlr-Swift-Runtime/pulls/comments/59140196","id":59140196,"diff_hunk":"@@ -33,10 +33,7 @@ extension Character {\n \n     //char ->  int\n     var unicodeValue: Int {\n-        for s in String(self).unicodeScalars {\n-            return Int(s.value)\n-        }\n-        return 0\n+        return Int(String(self).unicodeScalars.first?.value ?? 0)","path":"Antlr4/org/antlr/v4/runtime/misc/extension/CharacterExtension.swift","position":8,"original_position":8,"commit_id":"da547a081ce29ef8304ba188c9c2cd50d0a2f27d","original_commit_id":"da547a081ce29ef8304ba188c9c2cd50d0a2f27d","user":{"login":"artyom-razinov","id":6263432,"avatar_url":"https://avatars.githubusercontent.com/u/6263432?v=3","gravatar_id":"","url":"https://api.github.com/users/artyom-razinov","html_url":"https://github.com/artyom-razinov","followers_url":"https://api.github.com/users/artyom-razinov/followers","following_url":"https://api.github.com/users/artyom-razinov/following{/other_user}","gists_url":"https://api.github.com/users/artyom-razinov/gists{/gist_id}","starred_url":"https://api.github.com/users/artyom-razinov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/artyom-razinov/subscriptions","organizations_url":"https://api.github.com/users/artyom-razinov/orgs","repos_url":"https://api.github.com/users/artyom-razinov/repos","events_url":"https://api.github.com/users/artyom-razinov/events{/privacy}","received_events_url":"https://api.github.com/users/artyom-razinov/received_events","type":"User","site_admin":false},"body":"I don't know how, but previous code crashes in runtime","created_at":"2016-04-10T19:56:51Z","updated_at":"2016-04-10T19:56:51Z","html_url":"https://github.com/janyou/Antlr-Swift-Runtime/pull/5#discussion_r59140196","pull_request_url":"https://api.github.com/repos/janyou/Antlr-Swift-Runtime/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/janyou/Antlr-Swift-Runtime/pulls/comments/59140196"},"html":{"href":"https://github.com/janyou/Antlr-Swift-Runtime/pull/5#discussion_r59140196"},"pull_request":{"href":"https://api.github.com/repos/janyou/Antlr-Swift-Runtime/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/janyou/Antlr-Swift-Runtime/pulls/5","id":65920880,"html_url":"https://github.com/janyou/Antlr-Swift-Runtime/pull/5","diff_url":"https://github.com/janyou/Antlr-Swift-Runtime/pull/5.diff","patch_url":"https://github.com/janyou/Antlr-Swift-Runtime/pull/5.patch","issue_url":"https://api.github.com/repos/janyou/Antlr-Swift-Runtime/issues/5","number":5,"state":"open","locked":false,"title":"Master","user":{"login":"artyom-razinov","id":6263432,"avatar_url":"https://avatars.githubusercontent.com/u/6263432?v=3","gravatar_id":"","url":"https://api.github.com/users/artyom-razinov","html_url":"https://github.com/artyom-razinov","followers_url":"https://api.github.com/users/artyom-razinov/followers","following_url":"https://api.github.com/users/artyom-razinov/following{/other_user}","gists_url":"https://api.github.com/users/artyom-razinov/gists{/gist_id}","starred_url":"https://api.github.com/users/artyom-razinov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/artyom-razinov/subscriptions","organizations_url":"https://api.github.com/users/artyom-razinov/orgs","repos_url":"https://api.github.com/users/artyom-razinov/repos","events_url":"https://api.github.com/users/artyom-razinov/events{/privacy}","received_events_url":"https://api.github.com/users/artyom-razinov/received_events","type":"User","site_admin":false},"body":"I fixed two crashes, one of those was an overflow. E.g.: this would crash:\n\nlet y = UInt.max\nlet x = Int(y)\n\nAlso I've made IntStream contstants (EOF and UNKNOWN_SOURCE_NAME) public to allow creating custom streams.","created_at":"2016-04-10T19:55:57Z","updated_at":"2016-04-10T19:56:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5df72ac0d8ceef4a064e578e7fd9bdda6e845fbb","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/janyou/Antlr-Swift-Runtime/pulls/5/commits","review_comments_url":"https://api.github.com/repos/janyou/Antlr-Swift-Runtime/pulls/5/comments","review_comment_url":"https://api.github.com/repos/janyou/Antlr-Swift-Runtime/pulls/comments{/number}","comments_url":"https://api.github.com/repos/janyou/Antlr-Swift-Runtime/issues/5/comments","statuses_url":"https://api.github.com/repos/janyou/Antlr-Swift-Runtime/statuses/da547a081ce29ef8304ba188c9c2cd50d0a2f27d","head":{"label":"SwiftTools:master","ref":"master","sha":"da547a081ce29ef8304ba188c9c2cd50d0a2f27d","user":{"login":"SwiftTools","id":17404228,"avatar_url":"https://avatars.githubusercontent.com/u/17404228?v=3","gravatar_id":"","url":"https://api.github.com/users/SwiftTools","html_url":"https://github.com/SwiftTools","followers_url":"https://api.github.com/users/SwiftTools/followers","following_url":"https://api.github.com/users/SwiftTools/following{/other_user}","gists_url":"https://api.github.com/users/SwiftTools/gists{/gist_id}","starred_url":"https://api.github.com/users/SwiftTools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SwiftTools/subscriptions","organizations_url":"https://api.github.com/users/SwiftTools/orgs","repos_url":"https://api.github.com/users/SwiftTools/repos","events_url":"https://api.github.com/users/SwiftTools/events{/privacy}","received_events_url":"https://api.github.com/users/SwiftTools/received_events","type":"Organization","site_admin":false},"repo":{"id":55369530,"name":"Antlr-Swift-Runtime","full_name":"SwiftTools/Antlr-Swift-Runtime","owner":{"login":"SwiftTools","id":17404228,"avatar_url":"https://avatars.githubusercontent.com/u/17404228?v=3","gravatar_id":"","url":"https://api.github.com/users/SwiftTools","html_url":"https://github.com/SwiftTools","followers_url":"https://api.github.com/users/SwiftTools/followers","following_url":"https://api.github.com/users/SwiftTools/following{/other_user}","gists_url":"https://api.github.com/users/SwiftTools/gists{/gist_id}","starred_url":"https://api.github.com/users/SwiftTools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SwiftTools/subscriptions","organizations_url":"https://api.github.com/users/SwiftTools/orgs","repos_url":"https://api.github.com/users/SwiftTools/repos","events_url":"https://api.github.com/users/SwiftTools/events{/privacy}","received_events_url":"https://api.github.com/users/SwiftTools/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SwiftTools/Antlr-Swift-Runtime","description":"ANTLR v4.5.1 Swift Runtime","fork":true,"url":"https://api.github.com/repos/SwiftTools/Antlr-Swift-Runtime","forks_url":"https://api.github.com/repos/SwiftTools/Antlr-Swift-Runtime/forks","keys_url":"https://api.github.com/repos/SwiftTools/Antlr-Swift-Runtime/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SwiftTools/Antlr-Swift-Runtime/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SwiftTools/Antlr-Swift-Runtime/teams","hooks_url":"https://api.github.com/repos/SwiftTools/Antlr-Swift-Runtime/hooks","issue_events_url":"https://api.github.com/repos/SwiftTools/Antlr-Swift-Runtime/issues/events{/number}","events_url":"https://api.github.com/repos/SwiftTools/Antlr-Swift-Runtime/events","assignees_url":"https://api.github.com/repos/SwiftTools/Antlr-Swift-Runtime/assignees{/user}","branches_url":"https://api.github.com/repos/SwiftTools/Antlr-Swift-Runtime/branches{/branch}","tags_url":"https://api.github.com/repos/SwiftTools/Antlr-Swift-Runtime/tags","blobs_url":"https://api.github.com/repos/SwiftTools/Antlr-Swift-Runtime/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SwiftTools/Antlr-Swift-Runtime/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SwiftTools/Antlr-Swift-Runtime/git/refs{/sha}","trees_url":"https://api.github.com/repos/SwiftTools/Antlr-Swift-Runtime/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SwiftTools/Antlr-Swift-Runtime/statuses/{sha}","languages_url":"https://api.github.com/repos/SwiftTools/Antlr-Swift-Runtime/languages","stargazers_url":"https://api.github.com/repos/SwiftTools/Antlr-Swift-Runtime/stargazers","contributors_url":"https://api.github.com/repos/SwiftTools/Antlr-Swift-Runtime/contributors","subscribers_url":"https://api.github.com/repos/SwiftTools/Antlr-Swift-Runtime/subscribers","subscription_url":"https://api.github.com/repos/SwiftTools/Antlr-Swift-Runtime/subscription","commits_url":"https://api.github.com/repos/SwiftTools/Antlr-Swift-Runtime/commits{/sha}","git_commits_url":"https://api.github.com/repos/SwiftTools/Antlr-Swift-Runtime/git/commits{/sha}","comments_url":"https://api.github.com/repos/SwiftTools/Antlr-Swift-Runtime/comments{/number}","issue_comment_url":"https://api.github.com/repos/SwiftTools/Antlr-Swift-Runtime/issues/comments{/number}","contents_url":"https://api.github.com/repos/SwiftTools/Antlr-Swift-Runtime/contents/{+path}","compare_url":"https://api.github.com/repos/SwiftTools/Antlr-Swift-Runtime/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SwiftTools/Antlr-Swift-Runtime/merges","archive_url":"https://api.github.com/repos/SwiftTools/Antlr-Swift-Runtime/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SwiftTools/Antlr-Swift-Runtime/downloads","issues_url":"https://api.github.com/repos/SwiftTools/Antlr-Swift-Runtime/issues{/number}","pulls_url":"https://api.github.com/repos/SwiftTools/Antlr-Swift-Runtime/pulls{/number}","milestones_url":"https://api.github.com/repos/SwiftTools/Antlr-Swift-Runtime/milestones{/number}","notifications_url":"https://api.github.com/repos/SwiftTools/Antlr-Swift-Runtime/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SwiftTools/Antlr-Swift-Runtime/labels{/name}","releases_url":"https://api.github.com/repos/SwiftTools/Antlr-Swift-Runtime/releases{/id}","deployments_url":"https://api.github.com/repos/SwiftTools/Antlr-Swift-Runtime/deployments","created_at":"2016-04-03T21:18:11Z","updated_at":"2016-04-03T21:18:13Z","pushed_at":"2016-04-10T19:52:54Z","git_url":"git://github.com/SwiftTools/Antlr-Swift-Runtime.git","ssh_url":"git@github.com:SwiftTools/Antlr-Swift-Runtime.git","clone_url":"https://github.com/SwiftTools/Antlr-Swift-Runtime.git","svn_url":"https://github.com/SwiftTools/Antlr-Swift-Runtime","homepage":"","size":688,"stargazers_count":0,"watchers_count":0,"language":"Swift","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":"janyou:master","ref":"master","sha":"45ac2269520e158e3a1341b977df600fe763909f","user":{"login":"janyou","id":8850681,"avatar_url":"https://avatars.githubusercontent.com/u/8850681?v=3","gravatar_id":"","url":"https://api.github.com/users/janyou","html_url":"https://github.com/janyou","followers_url":"https://api.github.com/users/janyou/followers","following_url":"https://api.github.com/users/janyou/following{/other_user}","gists_url":"https://api.github.com/users/janyou/gists{/gist_id}","starred_url":"https://api.github.com/users/janyou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janyou/subscriptions","organizations_url":"https://api.github.com/users/janyou/orgs","repos_url":"https://api.github.com/users/janyou/repos","events_url":"https://api.github.com/users/janyou/events{/privacy}","received_events_url":"https://api.github.com/users/janyou/received_events","type":"User","site_admin":false},"repo":{"id":48692485,"name":"Antlr-Swift-Runtime","full_name":"janyou/Antlr-Swift-Runtime","owner":{"login":"janyou","id":8850681,"avatar_url":"https://avatars.githubusercontent.com/u/8850681?v=3","gravatar_id":"","url":"https://api.github.com/users/janyou","html_url":"https://github.com/janyou","followers_url":"https://api.github.com/users/janyou/followers","following_url":"https://api.github.com/users/janyou/following{/other_user}","gists_url":"https://api.github.com/users/janyou/gists{/gist_id}","starred_url":"https://api.github.com/users/janyou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janyou/subscriptions","organizations_url":"https://api.github.com/users/janyou/orgs","repos_url":"https://api.github.com/users/janyou/repos","events_url":"https://api.github.com/users/janyou/events{/privacy}","received_events_url":"https://api.github.com/users/janyou/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/janyou/Antlr-Swift-Runtime","description":"ANTLR v4.5.1 Swift Runtime","fork":false,"url":"https://api.github.com/repos/janyou/Antlr-Swift-Runtime","forks_url":"https://api.github.com/repos/janyou/Antlr-Swift-Runtime/forks","keys_url":"https://api.github.com/repos/janyou/Antlr-Swift-Runtime/keys{/key_id}","collaborators_url":"https://api.github.com/repos/janyou/Antlr-Swift-Runtime/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/janyou/Antlr-Swift-Runtime/teams","hooks_url":"https://api.github.com/repos/janyou/Antlr-Swift-Runtime/hooks","issue_events_url":"https://api.github.com/repos/janyou/Antlr-Swift-Runtime/issues/events{/number}","events_url":"https://api.github.com/repos/janyou/Antlr-Swift-Runtime/events","assignees_url":"https://api.github.com/repos/janyou/Antlr-Swift-Runtime/assignees{/user}","branches_url":"https://api.github.com/repos/janyou/Antlr-Swift-Runtime/branches{/branch}","tags_url":"https://api.github.com/repos/janyou/Antlr-Swift-Runtime/tags","blobs_url":"https://api.github.com/repos/janyou/Antlr-Swift-Runtime/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/janyou/Antlr-Swift-Runtime/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/janyou/Antlr-Swift-Runtime/git/refs{/sha}","trees_url":"https://api.github.com/repos/janyou/Antlr-Swift-Runtime/git/trees{/sha}","statuses_url":"https://api.github.com/repos/janyou/Antlr-Swift-Runtime/statuses/{sha}","languages_url":"https://api.github.com/repos/janyou/Antlr-Swift-Runtime/languages","stargazers_url":"https://api.github.com/repos/janyou/Antlr-Swift-Runtime/stargazers","contributors_url":"https://api.github.com/repos/janyou/Antlr-Swift-Runtime/contributors","subscribers_url":"https://api.github.com/repos/janyou/Antlr-Swift-Runtime/subscribers","subscription_url":"https://api.github.com/repos/janyou/Antlr-Swift-Runtime/subscription","commits_url":"https://api.github.com/repos/janyou/Antlr-Swift-Runtime/commits{/sha}","git_commits_url":"https://api.github.com/repos/janyou/Antlr-Swift-Runtime/git/commits{/sha}","comments_url":"https://api.github.com/repos/janyou/Antlr-Swift-Runtime/comments{/number}","issue_comment_url":"https://api.github.com/repos/janyou/Antlr-Swift-Runtime/issues/comments{/number}","contents_url":"https://api.github.com/repos/janyou/Antlr-Swift-Runtime/contents/{+path}","compare_url":"https://api.github.com/repos/janyou/Antlr-Swift-Runtime/compare/{base}...{head}","merges_url":"https://api.github.com/repos/janyou/Antlr-Swift-Runtime/merges","archive_url":"https://api.github.com/repos/janyou/Antlr-Swift-Runtime/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/janyou/Antlr-Swift-Runtime/downloads","issues_url":"https://api.github.com/repos/janyou/Antlr-Swift-Runtime/issues{/number}","pulls_url":"https://api.github.com/repos/janyou/Antlr-Swift-Runtime/pulls{/number}","milestones_url":"https://api.github.com/repos/janyou/Antlr-Swift-Runtime/milestones{/number}","notifications_url":"https://api.github.com/repos/janyou/Antlr-Swift-Runtime/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/janyou/Antlr-Swift-Runtime/labels{/name}","releases_url":"https://api.github.com/repos/janyou/Antlr-Swift-Runtime/releases{/id}","deployments_url":"https://api.github.com/repos/janyou/Antlr-Swift-Runtime/deployments","created_at":"2015-12-28T12:53:07Z","updated_at":"2016-04-03T21:02:27Z","pushed_at":"2016-04-10T19:55:57Z","git_url":"git://github.com/janyou/Antlr-Swift-Runtime.git","ssh_url":"git@github.com:janyou/Antlr-Swift-Runtime.git","clone_url":"https://github.com/janyou/Antlr-Swift-Runtime.git","svn_url":"https://github.com/janyou/Antlr-Swift-Runtime","homepage":"","size":683,"stargazers_count":4,"watchers_count":4,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":3,"forks":2,"open_issues":3,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/janyou/Antlr-Swift-Runtime/pulls/5"},"html":{"href":"https://github.com/janyou/Antlr-Swift-Runtime/pull/5"},"issue":{"href":"https://api.github.com/repos/janyou/Antlr-Swift-Runtime/issues/5"},"comments":{"href":"https://api.github.com/repos/janyou/Antlr-Swift-Runtime/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/janyou/Antlr-Swift-Runtime/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/janyou/Antlr-Swift-Runtime/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/janyou/Antlr-Swift-Runtime/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/janyou/Antlr-Swift-Runtime/statuses/da547a081ce29ef8304ba188c9c2cd50d0a2f27d"}}}}