{"action":"created","comment":{"url":"https://api.github.com/repos/apple/swift/pulls/comments/174208567","pull_request_review_id":103522556,"id":174208567,"diff_hunk":"@@ -410,4 +412,56 @@ struct ScalarEnumerationTraits<syntax::TriviaKind> {\n };\n } // namespace json\n } // namespace swift\n+\n+namespace llvm {\n+namespace yaml {\n+\n+/// Deserialization traits for TriviaPiece.\n+/// - All trivia pieces will have a \"kind\" key that contains the serialized\n+///   name of the trivia kind.\n+/// - Comment trivia will have the associated text of the comment under the\n+///   \"value\" key.\n+/// - All other trivia will have the associated integer count of their\n+///   occurrences under the \"value\" key.\n+template<>\n+struct MappingTraits<swift::syntax::TriviaPiece> {\n+  static swift::syntax::TriviaPiece mapping(IO &in) {\n+    swift::syntax::TriviaKind kind;\n+    in.mapRequired(\"kind\", kind);\n+    switch (kind) {\n+% for trivia in TRIVIAS:\n+    case swift::syntax::TriviaKind::${trivia.name}: {\n+% if trivia.is_collection():\n+\n+/// It would raise error when deserializing number with trailing character\n+/// eg. \"1\\n\"","path":"include/swift/Syntax/Trivia.h.gyb","position":51,"original_position":51,"commit_id":"46ceecba619fbc4d9f2cd79a76021a6772a1392c","original_commit_id":"46ceecba619fbc4d9f2cd79a76021a6772a1392c","user":{"login":"harlanhaskins","id":853032,"avatar_url":"https://avatars1.githubusercontent.com/u/853032?v=4","gravatar_id":"","url":"https://api.github.com/users/harlanhaskins","html_url":"https://github.com/harlanhaskins","followers_url":"https://api.github.com/users/harlanhaskins/followers","following_url":"https://api.github.com/users/harlanhaskins/following{/other_user}","gists_url":"https://api.github.com/users/harlanhaskins/gists{/gist_id}","starred_url":"https://api.github.com/users/harlanhaskins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harlanhaskins/subscriptions","organizations_url":"https://api.github.com/users/harlanhaskins/orgs","repos_url":"https://api.github.com/users/harlanhaskins/repos","events_url":"https://api.github.com/users/harlanhaskins/events{/privacy}","received_events_url":"https://api.github.com/users/harlanhaskins/received_events","type":"User","site_admin":false},"body":"Has this happened while testing this? If so, then the serialization should probably be updated.","created_at":"2018-03-13T16:59:19Z","updated_at":"2018-03-13T16:59:19Z","html_url":"https://github.com/apple/swift/pull/15203#discussion_r174208567","pull_request_url":"https://api.github.com/repos/apple/swift/pulls/15203","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/apple/swift/pulls/comments/174208567"},"html":{"href":"https://github.com/apple/swift/pull/15203#discussion_r174208567"},"pull_request":{"href":"https://api.github.com/repos/apple/swift/pulls/15203"}}},"pull_request":{"url":"https://api.github.com/repos/apple/swift/pulls/15203","id":174636842,"html_url":"https://github.com/apple/swift/pull/15203","diff_url":"https://github.com/apple/swift/pull/15203.diff","patch_url":"https://github.com/apple/swift/pull/15203.patch","issue_url":"https://api.github.com/repos/apple/swift/issues/15203","number":15203,"state":"open","locked":false,"title":"[Syntax]Add a deserializer that convert json to libSyntax tree","user":{"login":"DexinLi","id":4668026,"avatar_url":"https://avatars2.githubusercontent.com/u/4668026?v=4","gravatar_id":"","url":"https://api.github.com/users/DexinLi","html_url":"https://github.com/DexinLi","followers_url":"https://api.github.com/users/DexinLi/followers","following_url":"https://api.github.com/users/DexinLi/following{/other_user}","gists_url":"https://api.github.com/users/DexinLi/gists{/gist_id}","starred_url":"https://api.github.com/users/DexinLi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DexinLi/subscriptions","organizations_url":"https://api.github.com/users/DexinLi/orgs","repos_url":"https://api.github.com/users/DexinLi/repos","events_url":"https://api.github.com/users/DexinLi/events{/privacy}","received_events_url":"https://api.github.com/users/DexinLi/received_events","type":"User","site_admin":false},"body":"We already have a serializer generate json from libSyntax tree in https://github.com/apple/swift/blob/master/include/swift/Syntax/Serialization/SyntaxSerialization.h\r\nSo I wrote a deserializer that convert json to libSyntax tree, using llvm yaml parser.\r\n\r\n@rintaro I don't know how to add and run test in project `swift-syntax-test` \r\nI've tried passing a swift file as an argument but failed.\r\nPlease help me\r\n\r\n\r\n\r\n@swift-ci Please smoke test\r\n","created_at":"2018-03-13T11:56:33Z","updated_at":"2018-03-13T16:59:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fc057c9d22d9d18b1c11fc54938c8bf52be4e3ca","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/apple/swift/pulls/15203/commits","review_comments_url":"https://api.github.com/repos/apple/swift/pulls/15203/comments","review_comment_url":"https://api.github.com/repos/apple/swift/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apple/swift/issues/15203/comments","statuses_url":"https://api.github.com/repos/apple/swift/statuses/46ceecba619fbc4d9f2cd79a76021a6772a1392c","head":{"label":"DexinLi:deserializer","ref":"deserializer","sha":"46ceecba619fbc4d9f2cd79a76021a6772a1392c","user":{"login":"DexinLi","id":4668026,"avatar_url":"https://avatars2.githubusercontent.com/u/4668026?v=4","gravatar_id":"","url":"https://api.github.com/users/DexinLi","html_url":"https://github.com/DexinLi","followers_url":"https://api.github.com/users/DexinLi/followers","following_url":"https://api.github.com/users/DexinLi/following{/other_user}","gists_url":"https://api.github.com/users/DexinLi/gists{/gist_id}","starred_url":"https://api.github.com/users/DexinLi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DexinLi/subscriptions","organizations_url":"https://api.github.com/users/DexinLi/orgs","repos_url":"https://api.github.com/users/DexinLi/repos","events_url":"https://api.github.com/users/DexinLi/events{/privacy}","received_events_url":"https://api.github.com/users/DexinLi/received_events","type":"User","site_admin":false},"repo":{"id":124484650,"name":"swift","full_name":"DexinLi/swift","owner":{"login":"DexinLi","id":4668026,"avatar_url":"https://avatars2.githubusercontent.com/u/4668026?v=4","gravatar_id":"","url":"https://api.github.com/users/DexinLi","html_url":"https://github.com/DexinLi","followers_url":"https://api.github.com/users/DexinLi/followers","following_url":"https://api.github.com/users/DexinLi/following{/other_user}","gists_url":"https://api.github.com/users/DexinLi/gists{/gist_id}","starred_url":"https://api.github.com/users/DexinLi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DexinLi/subscriptions","organizations_url":"https://api.github.com/users/DexinLi/orgs","repos_url":"https://api.github.com/users/DexinLi/repos","events_url":"https://api.github.com/users/DexinLi/events{/privacy}","received_events_url":"https://api.github.com/users/DexinLi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/DexinLi/swift","description":"The Swift Programming Language","fork":true,"url":"https://api.github.com/repos/DexinLi/swift","forks_url":"https://api.github.com/repos/DexinLi/swift/forks","keys_url":"https://api.github.com/repos/DexinLi/swift/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DexinLi/swift/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DexinLi/swift/teams","hooks_url":"https://api.github.com/repos/DexinLi/swift/hooks","issue_events_url":"https://api.github.com/repos/DexinLi/swift/issues/events{/number}","events_url":"https://api.github.com/repos/DexinLi/swift/events","assignees_url":"https://api.github.com/repos/DexinLi/swift/assignees{/user}","branches_url":"https://api.github.com/repos/DexinLi/swift/branches{/branch}","tags_url":"https://api.github.com/repos/DexinLi/swift/tags","blobs_url":"https://api.github.com/repos/DexinLi/swift/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DexinLi/swift/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DexinLi/swift/git/refs{/sha}","trees_url":"https://api.github.com/repos/DexinLi/swift/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DexinLi/swift/statuses/{sha}","languages_url":"https://api.github.com/repos/DexinLi/swift/languages","stargazers_url":"https://api.github.com/repos/DexinLi/swift/stargazers","contributors_url":"https://api.github.com/repos/DexinLi/swift/contributors","subscribers_url":"https://api.github.com/repos/DexinLi/swift/subscribers","subscription_url":"https://api.github.com/repos/DexinLi/swift/subscription","commits_url":"https://api.github.com/repos/DexinLi/swift/commits{/sha}","git_commits_url":"https://api.github.com/repos/DexinLi/swift/git/commits{/sha}","comments_url":"https://api.github.com/repos/DexinLi/swift/comments{/number}","issue_comment_url":"https://api.github.com/repos/DexinLi/swift/issues/comments{/number}","contents_url":"https://api.github.com/repos/DexinLi/swift/contents/{+path}","compare_url":"https://api.github.com/repos/DexinLi/swift/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DexinLi/swift/merges","archive_url":"https://api.github.com/repos/DexinLi/swift/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DexinLi/swift/downloads","issues_url":"https://api.github.com/repos/DexinLi/swift/issues{/number}","pulls_url":"https://api.github.com/repos/DexinLi/swift/pulls{/number}","milestones_url":"https://api.github.com/repos/DexinLi/swift/milestones{/number}","notifications_url":"https://api.github.com/repos/DexinLi/swift/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DexinLi/swift/labels{/name}","releases_url":"https://api.github.com/repos/DexinLi/swift/releases{/id}","deployments_url":"https://api.github.com/repos/DexinLi/swift/deployments","created_at":"2018-03-09T03:50:37Z","updated_at":"2018-03-09T03:51:09Z","pushed_at":"2018-03-13T12:02:55Z","git_url":"git://github.com/DexinLi/swift.git","ssh_url":"git@github.com:DexinLi/swift.git","clone_url":"https://github.com/DexinLi/swift.git","svn_url":"https://github.com/DexinLi/swift","homepage":"https://swift.org/","size":264934,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apple:master","ref":"master","sha":"d06ba63d21a41f2eb9c2985c3e73e0847390851f","user":{"login":"apple","id":10639145,"avatar_url":"https://avatars0.githubusercontent.com/u/10639145?v=4","gravatar_id":"","url":"https://api.github.com/users/apple","html_url":"https://github.com/apple","followers_url":"https://api.github.com/users/apple/followers","following_url":"https://api.github.com/users/apple/following{/other_user}","gists_url":"https://api.github.com/users/apple/gists{/gist_id}","starred_url":"https://api.github.com/users/apple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apple/subscriptions","organizations_url":"https://api.github.com/users/apple/orgs","repos_url":"https://api.github.com/users/apple/repos","events_url":"https://api.github.com/users/apple/events{/privacy}","received_events_url":"https://api.github.com/users/apple/received_events","type":"Organization","site_admin":false},"repo":{"id":44838949,"name":"swift","full_name":"apple/swift","owner":{"login":"apple","id":10639145,"avatar_url":"https://avatars0.githubusercontent.com/u/10639145?v=4","gravatar_id":"","url":"https://api.github.com/users/apple","html_url":"https://github.com/apple","followers_url":"https://api.github.com/users/apple/followers","following_url":"https://api.github.com/users/apple/following{/other_user}","gists_url":"https://api.github.com/users/apple/gists{/gist_id}","starred_url":"https://api.github.com/users/apple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apple/subscriptions","organizations_url":"https://api.github.com/users/apple/orgs","repos_url":"https://api.github.com/users/apple/repos","events_url":"https://api.github.com/users/apple/events{/privacy}","received_events_url":"https://api.github.com/users/apple/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apple/swift","description":"The Swift Programming Language","fork":false,"url":"https://api.github.com/repos/apple/swift","forks_url":"https://api.github.com/repos/apple/swift/forks","keys_url":"https://api.github.com/repos/apple/swift/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apple/swift/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apple/swift/teams","hooks_url":"https://api.github.com/repos/apple/swift/hooks","issue_events_url":"https://api.github.com/repos/apple/swift/issues/events{/number}","events_url":"https://api.github.com/repos/apple/swift/events","assignees_url":"https://api.github.com/repos/apple/swift/assignees{/user}","branches_url":"https://api.github.com/repos/apple/swift/branches{/branch}","tags_url":"https://api.github.com/repos/apple/swift/tags","blobs_url":"https://api.github.com/repos/apple/swift/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apple/swift/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apple/swift/git/refs{/sha}","trees_url":"https://api.github.com/repos/apple/swift/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apple/swift/statuses/{sha}","languages_url":"https://api.github.com/repos/apple/swift/languages","stargazers_url":"https://api.github.com/repos/apple/swift/stargazers","contributors_url":"https://api.github.com/repos/apple/swift/contributors","subscribers_url":"https://api.github.com/repos/apple/swift/subscribers","subscription_url":"https://api.github.com/repos/apple/swift/subscription","commits_url":"https://api.github.com/repos/apple/swift/commits{/sha}","git_commits_url":"https://api.github.com/repos/apple/swift/git/commits{/sha}","comments_url":"https://api.github.com/repos/apple/swift/comments{/number}","issue_comment_url":"https://api.github.com/repos/apple/swift/issues/comments{/number}","contents_url":"https://api.github.com/repos/apple/swift/contents/{+path}","compare_url":"https://api.github.com/repos/apple/swift/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apple/swift/merges","archive_url":"https://api.github.com/repos/apple/swift/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apple/swift/downloads","issues_url":"https://api.github.com/repos/apple/swift/issues{/number}","pulls_url":"https://api.github.com/repos/apple/swift/pulls{/number}","milestones_url":"https://api.github.com/repos/apple/swift/milestones{/number}","notifications_url":"https://api.github.com/repos/apple/swift/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apple/swift/labels{/name}","releases_url":"https://api.github.com/repos/apple/swift/releases{/id}","deployments_url":"https://api.github.com/repos/apple/swift/deployments","created_at":"2015-10-23T21:15:07Z","updated_at":"2018-03-13T16:58:27Z","pushed_at":"2018-03-13T16:56:32Z","git_url":"git://github.com/apple/swift.git","ssh_url":"git@github.com:apple/swift.git","clone_url":"https://github.com/apple/swift.git","svn_url":"https://github.com/apple/swift","homepage":"https://swift.org/","size":266286,"stargazers_count":42950,"watchers_count":42950,"language":"C++","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":6766,"mirror_url":null,"archived":false,"open_issues_count":293,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":6766,"open_issues":293,"watchers":42950,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apple/swift/pulls/15203"},"html":{"href":"https://github.com/apple/swift/pull/15203"},"issue":{"href":"https://api.github.com/repos/apple/swift/issues/15203"},"comments":{"href":"https://api.github.com/repos/apple/swift/issues/15203/comments"},"review_comments":{"href":"https://api.github.com/repos/apple/swift/pulls/15203/comments"},"review_comment":{"href":"https://api.github.com/repos/apple/swift/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apple/swift/pulls/15203/commits"},"statuses":{"href":"https://api.github.com/repos/apple/swift/statuses/46ceecba619fbc4d9f2cd79a76021a6772a1392c"}},"author_association":"NONE"}}
{"actor":{"display_login":"harlanhaskins"}}