{"action":"created","comment":{"url":"https://api.github.com/repos/heremaps/flatdata/pulls/comments/198053223","pull_request_review_id":131910700,"id":198053223,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5ODA1MzIyMw==","diff_hunk":"@@ -0,0 +1,76 @@\n+'''\n+ Copyright (c) 2018 HERE Europe B.V.\n+ See the LICENSE file in the root of this project for license details.\n+'''\n+\n+from generator.tree.nodes.resources import (Vector, Multivector, Instance, RawData, BoundResource,\n+    Archive as ArchiveResource)\n+from generator.tree.nodes.trivial import Structure, Constant, Enumeration\n+from generator.tree.nodes.archive import Archive\n+from generator.tree.syntax_tree import SyntaxTree\n+from .BaseGenerator import BaseGenerator\n+\n+import re\n+\n+class RustGenerator(BaseGenerator):\n+\n+    RESERVED_KEYWORDS = [\n+        \"abstract\", \"alignof\", \"as\", \"become\", \"box\", \"break\", \"const\", \"continue\", \"crate\", \"do\",\n+        \"else\", \"enum\", \"extern\", \"false\", \"final\", \"fn\", \"for\", \"if\", \"impl\", \"in\", \"let\", \"loop\",\n+        \"macro\", \"match\", \"mod\", \"move\", \"mut\", \"offsetof\", \"override\", \"priv\", \"proc\", \"pub\",\n+        \"pure\", \"ref\", \"return\", \"self\", \"sizeof\", \"static\", \"struct\", \"super\", \"trait\", \"true\",\n+        \"type\", \"typeof\", \"unsafe\", \"unsized\", \"use\", \"virtual\", \"where\", \"while\", \"yield\"]\n+\n+    def __init__(self):\n+        BaseGenerator.__init__(self, \"rust/rust.jinja2\")\n+\n+    def _supported_nodes(self):\n+        return [Structure, Archive, Constant, Enumeration]\n+\n+    def _populate_environment(self, env):\n+        def _camel_to_snake_case(s):\n+            s1 = re.sub('(.)([A-Z][a-z]+)', r'\\1_\\2', s)\n+            return re.sub('([a-z0-9])(A-Z)', r'\\1_\\2', s1).lower()\n+\n+        env.filters[\"camel_to_snake_case\"] = _camel_to_snake_case\n+\n+        def _snake_to_upper_camel_case(s):\n+            return ''.join(p.title() for p in  s.split('_'))\n+\n+        env.filters[\"snake_to_upper_camel_case\"] = _snake_to_upper_camel_case\n+\n+        def _rust_doc(s):\n+            lines = [\n+                re.sub(r'^[ \\t]*(/\\*\\*|/\\*|\\*/|\\*)\\s*(.*?)\\s*(\\*/)?$', r\"/// \\2\", line).strip()\n+                for line in s.split('\\n')\n+            ]\n+            start = 0\n+            end = len(lines)\n+            if lines[0] == \"///\":\n+                start = 1\n+            if lines[-1] == \"///\":\n+                end = -1;\n+            return \"\\n\".join(lines[start:end])","path":"generator/generators/RustGenerator.py","position":53,"original_position":53,"commit_id":"667b54e5bd647066de88e3080eed6a5889e88e59","original_commit_id":"667b54e5bd647066de88e3080eed6a5889e88e59","user":{"login":"imagovrn","id":7044014,"node_id":"MDQ6VXNlcjcwNDQwMTQ=","avatar_url":"https://avatars3.githubusercontent.com/u/7044014?v=4","gravatar_id":"","url":"https://api.github.com/users/imagovrn","html_url":"https://github.com/imagovrn","followers_url":"https://api.github.com/users/imagovrn/followers","following_url":"https://api.github.com/users/imagovrn/following{/other_user}","gists_url":"https://api.github.com/users/imagovrn/gists{/gist_id}","starred_url":"https://api.github.com/users/imagovrn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imagovrn/subscriptions","organizations_url":"https://api.github.com/users/imagovrn/orgs","repos_url":"https://api.github.com/users/imagovrn/repos","events_url":"https://api.github.com/users/imagovrn/events{/privacy}","received_events_url":"https://api.github.com/users/imagovrn/received_events","type":"User","site_admin":false},"body":"`_rust_doc` might not work well on empty `lines`","created_at":"2018-06-26T08:22:02Z","updated_at":"2018-06-26T08:22:02Z","html_url":"https://github.com/heremaps/flatdata/pull/34#discussion_r198053223","pull_request_url":"https://api.github.com/repos/heremaps/flatdata/pulls/34","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/heremaps/flatdata/pulls/comments/198053223"},"html":{"href":"https://github.com/heremaps/flatdata/pull/34#discussion_r198053223"},"pull_request":{"href":"https://api.github.com/repos/heremaps/flatdata/pulls/34"}}},"pull_request":{"url":"https://api.github.com/repos/heremaps/flatdata/pulls/34","id":189243164,"node_id":"MDExOlB1bGxSZXF1ZXN0MTg5MjQzMTY0","html_url":"https://github.com/heremaps/flatdata/pull/34","diff_url":"https://github.com/heremaps/flatdata/pull/34.diff","patch_url":"https://github.com/heremaps/flatdata/pull/34.patch","issue_url":"https://api.github.com/repos/heremaps/flatdata/issues/34","number":34,"state":"open","locked":false,"title":"Rust generator","user":{"login":"boxdot","id":3841359,"node_id":"MDQ6VXNlcjM4NDEzNTk=","avatar_url":"https://avatars3.githubusercontent.com/u/3841359?v=4","gravatar_id":"","url":"https://api.github.com/users/boxdot","html_url":"https://github.com/boxdot","followers_url":"https://api.github.com/users/boxdot/followers","following_url":"https://api.github.com/users/boxdot/following{/other_user}","gists_url":"https://api.github.com/users/boxdot/gists{/gist_id}","starred_url":"https://api.github.com/users/boxdot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boxdot/subscriptions","organizations_url":"https://api.github.com/users/boxdot/orgs","repos_url":"https://api.github.com/users/boxdot/repos","events_url":"https://api.github.com/users/boxdot/events{/privacy}","received_events_url":"https://api.github.com/users/boxdot/received_events","type":"User","site_admin":false},"body":"Also extend the coappearances examples to show how to use optional subarchives, which do not have to be serialized directly and may be added later.","created_at":"2018-05-20T17:21:35Z","updated_at":"2018-06-26T08:22:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"028e96b1bafbc1782b3d8a53421f96c5a5059b04","assignee":{"login":"imagovrn","id":7044014,"node_id":"MDQ6VXNlcjcwNDQwMTQ=","avatar_url":"https://avatars3.githubusercontent.com/u/7044014?v=4","gravatar_id":"","url":"https://api.github.com/users/imagovrn","html_url":"https://github.com/imagovrn","followers_url":"https://api.github.com/users/imagovrn/followers","following_url":"https://api.github.com/users/imagovrn/following{/other_user}","gists_url":"https://api.github.com/users/imagovrn/gists{/gist_id}","starred_url":"https://api.github.com/users/imagovrn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imagovrn/subscriptions","organizations_url":"https://api.github.com/users/imagovrn/orgs","repos_url":"https://api.github.com/users/imagovrn/repos","events_url":"https://api.github.com/users/imagovrn/events{/privacy}","received_events_url":"https://api.github.com/users/imagovrn/received_events","type":"User","site_admin":false},"assignees":[{"login":"imagovrn","id":7044014,"node_id":"MDQ6VXNlcjcwNDQwMTQ=","avatar_url":"https://avatars3.githubusercontent.com/u/7044014?v=4","gravatar_id":"","url":"https://api.github.com/users/imagovrn","html_url":"https://github.com/imagovrn","followers_url":"https://api.github.com/users/imagovrn/followers","following_url":"https://api.github.com/users/imagovrn/following{/other_user}","gists_url":"https://api.github.com/users/imagovrn/gists{/gist_id}","starred_url":"https://api.github.com/users/imagovrn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imagovrn/subscriptions","organizations_url":"https://api.github.com/users/imagovrn/orgs","repos_url":"https://api.github.com/users/imagovrn/repos","events_url":"https://api.github.com/users/imagovrn/events{/privacy}","received_events_url":"https://api.github.com/users/imagovrn/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/heremaps/flatdata/pulls/34/commits","review_comments_url":"https://api.github.com/repos/heremaps/flatdata/pulls/34/comments","review_comment_url":"https://api.github.com/repos/heremaps/flatdata/pulls/comments{/number}","comments_url":"https://api.github.com/repos/heremaps/flatdata/issues/34/comments","statuses_url":"https://api.github.com/repos/heremaps/flatdata/statuses/667b54e5bd647066de88e3080eed6a5889e88e59","head":{"label":"heremaps:rust-generator","ref":"rust-generator","sha":"667b54e5bd647066de88e3080eed6a5889e88e59","user":{"login":"heremaps","id":2835506,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI4MzU1MDY=","avatar_url":"https://avatars0.githubusercontent.com/u/2835506?v=4","gravatar_id":"","url":"https://api.github.com/users/heremaps","html_url":"https://github.com/heremaps","followers_url":"https://api.github.com/users/heremaps/followers","following_url":"https://api.github.com/users/heremaps/following{/other_user}","gists_url":"https://api.github.com/users/heremaps/gists{/gist_id}","starred_url":"https://api.github.com/users/heremaps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heremaps/subscriptions","organizations_url":"https://api.github.com/users/heremaps/orgs","repos_url":"https://api.github.com/users/heremaps/repos","events_url":"https://api.github.com/users/heremaps/events{/privacy}","received_events_url":"https://api.github.com/users/heremaps/received_events","type":"Organization","site_admin":false},"repo":{"id":118035076,"node_id":"MDEwOlJlcG9zaXRvcnkxMTgwMzUwNzY=","name":"flatdata","full_name":"heremaps/flatdata","owner":{"login":"heremaps","id":2835506,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI4MzU1MDY=","avatar_url":"https://avatars0.githubusercontent.com/u/2835506?v=4","gravatar_id":"","url":"https://api.github.com/users/heremaps","html_url":"https://github.com/heremaps","followers_url":"https://api.github.com/users/heremaps/followers","following_url":"https://api.github.com/users/heremaps/following{/other_user}","gists_url":"https://api.github.com/users/heremaps/gists{/gist_id}","starred_url":"https://api.github.com/users/heremaps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heremaps/subscriptions","organizations_url":"https://api.github.com/users/heremaps/orgs","repos_url":"https://api.github.com/users/heremaps/repos","events_url":"https://api.github.com/users/heremaps/events{/privacy}","received_events_url":"https://api.github.com/users/heremaps/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/heremaps/flatdata","description":"Zero copy memory-mapped data storage ","fork":false,"url":"https://api.github.com/repos/heremaps/flatdata","forks_url":"https://api.github.com/repos/heremaps/flatdata/forks","keys_url":"https://api.github.com/repos/heremaps/flatdata/keys{/key_id}","collaborators_url":"https://api.github.com/repos/heremaps/flatdata/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/heremaps/flatdata/teams","hooks_url":"https://api.github.com/repos/heremaps/flatdata/hooks","issue_events_url":"https://api.github.com/repos/heremaps/flatdata/issues/events{/number}","events_url":"https://api.github.com/repos/heremaps/flatdata/events","assignees_url":"https://api.github.com/repos/heremaps/flatdata/assignees{/user}","branches_url":"https://api.github.com/repos/heremaps/flatdata/branches{/branch}","tags_url":"https://api.github.com/repos/heremaps/flatdata/tags","blobs_url":"https://api.github.com/repos/heremaps/flatdata/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/heremaps/flatdata/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/heremaps/flatdata/git/refs{/sha}","trees_url":"https://api.github.com/repos/heremaps/flatdata/git/trees{/sha}","statuses_url":"https://api.github.com/repos/heremaps/flatdata/statuses/{sha}","languages_url":"https://api.github.com/repos/heremaps/flatdata/languages","stargazers_url":"https://api.github.com/repos/heremaps/flatdata/stargazers","contributors_url":"https://api.github.com/repos/heremaps/flatdata/contributors","subscribers_url":"https://api.github.com/repos/heremaps/flatdata/subscribers","subscription_url":"https://api.github.com/repos/heremaps/flatdata/subscription","commits_url":"https://api.github.com/repos/heremaps/flatdata/commits{/sha}","git_commits_url":"https://api.github.com/repos/heremaps/flatdata/git/commits{/sha}","comments_url":"https://api.github.com/repos/heremaps/flatdata/comments{/number}","issue_comment_url":"https://api.github.com/repos/heremaps/flatdata/issues/comments{/number}","contents_url":"https://api.github.com/repos/heremaps/flatdata/contents/{+path}","compare_url":"https://api.github.com/repos/heremaps/flatdata/compare/{base}...{head}","merges_url":"https://api.github.com/repos/heremaps/flatdata/merges","archive_url":"https://api.github.com/repos/heremaps/flatdata/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/heremaps/flatdata/downloads","issues_url":"https://api.github.com/repos/heremaps/flatdata/issues{/number}","pulls_url":"https://api.github.com/repos/heremaps/flatdata/pulls{/number}","milestones_url":"https://api.github.com/repos/heremaps/flatdata/milestones{/number}","notifications_url":"https://api.github.com/repos/heremaps/flatdata/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/heremaps/flatdata/labels{/name}","releases_url":"https://api.github.com/repos/heremaps/flatdata/releases{/id}","deployments_url":"https://api.github.com/repos/heremaps/flatdata/deployments","created_at":"2018-01-18T20:34:58Z","updated_at":"2018-06-19T21:02:16Z","pushed_at":"2018-06-26T07:37:11Z","git_url":"git://github.com/heremaps/flatdata.git","ssh_url":"git@github.com:heremaps/flatdata.git","clone_url":"https://github.com/heremaps/flatdata.git","svn_url":"https://github.com/heremaps/flatdata","homepage":"https://heremaps.github.io/flatdata/","size":492,"stargazers_count":33,"watchers_count":33,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":6,"mirror_url":null,"archived":false,"open_issues_count":13,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":6,"open_issues":13,"watchers":33,"default_branch":"master"}},"base":{"label":"heremaps:master","ref":"master","sha":"82aa5326e54090e1e429d42ffcf31a1288475dfe","user":{"login":"heremaps","id":2835506,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI4MzU1MDY=","avatar_url":"https://avatars0.githubusercontent.com/u/2835506?v=4","gravatar_id":"","url":"https://api.github.com/users/heremaps","html_url":"https://github.com/heremaps","followers_url":"https://api.github.com/users/heremaps/followers","following_url":"https://api.github.com/users/heremaps/following{/other_user}","gists_url":"https://api.github.com/users/heremaps/gists{/gist_id}","starred_url":"https://api.github.com/users/heremaps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heremaps/subscriptions","organizations_url":"https://api.github.com/users/heremaps/orgs","repos_url":"https://api.github.com/users/heremaps/repos","events_url":"https://api.github.com/users/heremaps/events{/privacy}","received_events_url":"https://api.github.com/users/heremaps/received_events","type":"Organization","site_admin":false},"repo":{"id":118035076,"node_id":"MDEwOlJlcG9zaXRvcnkxMTgwMzUwNzY=","name":"flatdata","full_name":"heremaps/flatdata","owner":{"login":"heremaps","id":2835506,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI4MzU1MDY=","avatar_url":"https://avatars0.githubusercontent.com/u/2835506?v=4","gravatar_id":"","url":"https://api.github.com/users/heremaps","html_url":"https://github.com/heremaps","followers_url":"https://api.github.com/users/heremaps/followers","following_url":"https://api.github.com/users/heremaps/following{/other_user}","gists_url":"https://api.github.com/users/heremaps/gists{/gist_id}","starred_url":"https://api.github.com/users/heremaps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heremaps/subscriptions","organizations_url":"https://api.github.com/users/heremaps/orgs","repos_url":"https://api.github.com/users/heremaps/repos","events_url":"https://api.github.com/users/heremaps/events{/privacy}","received_events_url":"https://api.github.com/users/heremaps/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/heremaps/flatdata","description":"Zero copy memory-mapped data storage ","fork":false,"url":"https://api.github.com/repos/heremaps/flatdata","forks_url":"https://api.github.com/repos/heremaps/flatdata/forks","keys_url":"https://api.github.com/repos/heremaps/flatdata/keys{/key_id}","collaborators_url":"https://api.github.com/repos/heremaps/flatdata/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/heremaps/flatdata/teams","hooks_url":"https://api.github.com/repos/heremaps/flatdata/hooks","issue_events_url":"https://api.github.com/repos/heremaps/flatdata/issues/events{/number}","events_url":"https://api.github.com/repos/heremaps/flatdata/events","assignees_url":"https://api.github.com/repos/heremaps/flatdata/assignees{/user}","branches_url":"https://api.github.com/repos/heremaps/flatdata/branches{/branch}","tags_url":"https://api.github.com/repos/heremaps/flatdata/tags","blobs_url":"https://api.github.com/repos/heremaps/flatdata/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/heremaps/flatdata/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/heremaps/flatdata/git/refs{/sha}","trees_url":"https://api.github.com/repos/heremaps/flatdata/git/trees{/sha}","statuses_url":"https://api.github.com/repos/heremaps/flatdata/statuses/{sha}","languages_url":"https://api.github.com/repos/heremaps/flatdata/languages","stargazers_url":"https://api.github.com/repos/heremaps/flatdata/stargazers","contributors_url":"https://api.github.com/repos/heremaps/flatdata/contributors","subscribers_url":"https://api.github.com/repos/heremaps/flatdata/subscribers","subscription_url":"https://api.github.com/repos/heremaps/flatdata/subscription","commits_url":"https://api.github.com/repos/heremaps/flatdata/commits{/sha}","git_commits_url":"https://api.github.com/repos/heremaps/flatdata/git/commits{/sha}","comments_url":"https://api.github.com/repos/heremaps/flatdata/comments{/number}","issue_comment_url":"https://api.github.com/repos/heremaps/flatdata/issues/comments{/number}","contents_url":"https://api.github.com/repos/heremaps/flatdata/contents/{+path}","compare_url":"https://api.github.com/repos/heremaps/flatdata/compare/{base}...{head}","merges_url":"https://api.github.com/repos/heremaps/flatdata/merges","archive_url":"https://api.github.com/repos/heremaps/flatdata/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/heremaps/flatdata/downloads","issues_url":"https://api.github.com/repos/heremaps/flatdata/issues{/number}","pulls_url":"https://api.github.com/repos/heremaps/flatdata/pulls{/number}","milestones_url":"https://api.github.com/repos/heremaps/flatdata/milestones{/number}","notifications_url":"https://api.github.com/repos/heremaps/flatdata/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/heremaps/flatdata/labels{/name}","releases_url":"https://api.github.com/repos/heremaps/flatdata/releases{/id}","deployments_url":"https://api.github.com/repos/heremaps/flatdata/deployments","created_at":"2018-01-18T20:34:58Z","updated_at":"2018-06-19T21:02:16Z","pushed_at":"2018-06-26T07:37:11Z","git_url":"git://github.com/heremaps/flatdata.git","ssh_url":"git@github.com:heremaps/flatdata.git","clone_url":"https://github.com/heremaps/flatdata.git","svn_url":"https://github.com/heremaps/flatdata","homepage":"https://heremaps.github.io/flatdata/","size":492,"stargazers_count":33,"watchers_count":33,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":6,"mirror_url":null,"archived":false,"open_issues_count":13,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":6,"open_issues":13,"watchers":33,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/heremaps/flatdata/pulls/34"},"html":{"href":"https://github.com/heremaps/flatdata/pull/34"},"issue":{"href":"https://api.github.com/repos/heremaps/flatdata/issues/34"},"comments":{"href":"https://api.github.com/repos/heremaps/flatdata/issues/34/comments"},"review_comments":{"href":"https://api.github.com/repos/heremaps/flatdata/pulls/34/comments"},"review_comment":{"href":"https://api.github.com/repos/heremaps/flatdata/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/heremaps/flatdata/pulls/34/commits"},"statuses":{"href":"https://api.github.com/repos/heremaps/flatdata/statuses/667b54e5bd647066de88e3080eed6a5889e88e59"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"imagovrn"}}