{"action":"created","comment":{"url":"https://api.github.com/repos/ballerina-lang/ballerina/pulls/comments/178275689","pull_request_review_id":108313325,"id":178275689,"diff_hunk":"@@ -58,8 +60,59 @@ public void exitKeyVal(TomlParser.KeyValContext context) {\n     }\n \n     @Override\n-    public void enterKey(TomlParser.KeyContext context) {\n-        currentKey = context.getText();\n+    public void enterSimpleKey(TomlParser.SimpleKeyContext context) {\n+        if (!isDottedKey) {\n+            currentKey = new StringBuilder(context.getText());\n+        } else {\n+            super.enterSimpleKey(context);\n+        }\n+    }\n+\n+    @Override\n+    public void enterDottedKey(TomlParser.DottedKeyContext context) {\n+        isDottedKey = true;\n+    }\n+\n+    @Override\n+    public void enterDotSep(TomlParser.DotSepContext context) {\n+        if (isDottedKey) {\n+            currentKey = currentKey.append(context.getText());\n+        } else {\n+            super.enterDotSep(context);\n+        }\n+    }\n+\n+    @Override\n+    public void enterQuotedKey(TomlParser.QuotedKeyContext context) {\n+        if (isDottedKey) {\n+            // if this is a dotted key, need to build the current key by appending\n+            if (currentKey != null && !currentKey.toString().isEmpty()) {\n+                currentKey = currentKey.append(new StringBuilder(context.basicString().basicStringValue().getText()));\n+            } else {\n+                currentKey = new StringBuilder(context.basicString().basicStringValue().getText());\n+            }\n+        } else {\n+            currentKey = new StringBuilder(context.basicString().basicStringValue().getText());\n+        }\n+    }\n+\n+    @Override\n+    public void enterUnquotedKey(TomlParser.UnquotedKeyContext context) {\n+        if (isDottedKey) {\n+            // if this is a dotted key, need to build the current key by appending\n+            if (currentKey != null && !currentKey.toString().isEmpty()) {\n+                currentKey = currentKey.append(new StringBuilder(context.getText()));\n+            } else {\n+                currentKey = new StringBuilder(context.getText());\n+            }\n+        } else {\n+            currentKey = new StringBuilder(context.getText());\n+        }\n+    }\n+\n+    @Override\n+    public void exitDottedKey(TomlParser.DottedKeyContext ctx) {\n+        isDottedKey = false;","path":"stdlib/ballerina-config/src/main/java/org/ballerinalang/bcl/parser/BConfigLangListener.java","position":81,"original_position":81,"commit_id":"76df230e1be238d599933c5d632246e9047eb31d","original_commit_id":"76df230e1be238d599933c5d632246e9047eb31d","user":{"login":"pubudu91","id":6260009,"avatar_url":"https://avatars2.githubusercontent.com/u/6260009?v=4","gravatar_id":"","url":"https://api.github.com/users/pubudu91","html_url":"https://github.com/pubudu91","followers_url":"https://api.github.com/users/pubudu91/followers","following_url":"https://api.github.com/users/pubudu91/following{/other_user}","gists_url":"https://api.github.com/users/pubudu91/gists{/gist_id}","starred_url":"https://api.github.com/users/pubudu91/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pubudu91/subscriptions","organizations_url":"https://api.github.com/users/pubudu91/orgs","repos_url":"https://api.github.com/users/pubudu91/repos","events_url":"https://api.github.com/users/pubudu91/events{/privacy}","received_events_url":"https://api.github.com/users/pubudu91/received_events","type":"User","site_admin":false},"body":"We can simplify this logic for the keys can't we? The rules we have to concentrate on are, `key`, `dotSep`, `unquotedKey` and `quotedKey`. The following should work I think:\r\n```\r\nenterKey -> create a new StringBuilder for current key\r\nenterQuotedKey -> append the basicStringValue to current key\r\nenterUnquotedKey -> append the value to current key\r\nenterDotSep -> append the value to current key\r\n```","created_at":"2018-03-30T11:25:38Z","updated_at":"2018-03-30T11:26:15Z","html_url":"https://github.com/ballerina-lang/ballerina/pull/6108#discussion_r178275689","pull_request_url":"https://api.github.com/repos/ballerina-lang/ballerina/pulls/6108","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/ballerina-lang/ballerina/pulls/comments/178275689"},"html":{"href":"https://github.com/ballerina-lang/ballerina/pull/6108#discussion_r178275689"},"pull_request":{"href":"https://api.github.com/repos/ballerina-lang/ballerina/pulls/6108"}}},"pull_request":{"url":"https://api.github.com/repos/ballerina-lang/ballerina/pulls/6108","id":178274299,"html_url":"https://github.com/ballerina-lang/ballerina/pull/6108","diff_url":"https://github.com/ballerina-lang/ballerina/pull/6108.diff","patch_url":"https://github.com/ballerina-lang/ballerina/pull/6108.patch","issue_url":"https://api.github.com/repos/ballerina-lang/ballerina/issues/6108","number":6108,"state":"open","locked":false,"title":"Fix config API for config keys with quotation marks","user":{"login":"isurulucky","id":2777052,"avatar_url":"https://avatars0.githubusercontent.com/u/2777052?v=4","gravatar_id":"","url":"https://api.github.com/users/isurulucky","html_url":"https://github.com/isurulucky","followers_url":"https://api.github.com/users/isurulucky/followers","following_url":"https://api.github.com/users/isurulucky/following{/other_user}","gists_url":"https://api.github.com/users/isurulucky/gists{/gist_id}","starred_url":"https://api.github.com/users/isurulucky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/isurulucky/subscriptions","organizations_url":"https://api.github.com/users/isurulucky/orgs","repos_url":"https://api.github.com/users/isurulucky/repos","events_url":"https://api.github.com/users/isurulucky/events{/privacy}","received_events_url":"https://api.github.com/users/isurulucky/received_events","type":"User","site_admin":false},"body":"## Purpose\r\n> Fix for https://github.com/ballerina-lang/ballerina/issues/6105.","created_at":"2018-03-29T09:31:03Z","updated_at":"2018-03-30T11:26:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5e1672bff173a60736badae0feec0823f8f033c4","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ballerina-lang/ballerina/pulls/6108/commits","review_comments_url":"https://api.github.com/repos/ballerina-lang/ballerina/pulls/6108/comments","review_comment_url":"https://api.github.com/repos/ballerina-lang/ballerina/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ballerina-lang/ballerina/issues/6108/comments","statuses_url":"https://api.github.com/repos/ballerina-lang/ballerina/statuses/76df230e1be238d599933c5d632246e9047eb31d","head":{"label":"isurulucky:broken_master_with_package_changes","ref":"broken_master_with_package_changes","sha":"76df230e1be238d599933c5d632246e9047eb31d","user":{"login":"isurulucky","id":2777052,"avatar_url":"https://avatars0.githubusercontent.com/u/2777052?v=4","gravatar_id":"","url":"https://api.github.com/users/isurulucky","html_url":"https://github.com/isurulucky","followers_url":"https://api.github.com/users/isurulucky/followers","following_url":"https://api.github.com/users/isurulucky/following{/other_user}","gists_url":"https://api.github.com/users/isurulucky/gists{/gist_id}","starred_url":"https://api.github.com/users/isurulucky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/isurulucky/subscriptions","organizations_url":"https://api.github.com/users/isurulucky/orgs","repos_url":"https://api.github.com/users/isurulucky/repos","events_url":"https://api.github.com/users/isurulucky/events{/privacy}","received_events_url":"https://api.github.com/users/isurulucky/received_events","type":"User","site_admin":false},"repo":{"id":122618419,"name":"ballerina","full_name":"isurulucky/ballerina","owner":{"login":"isurulucky","id":2777052,"avatar_url":"https://avatars0.githubusercontent.com/u/2777052?v=4","gravatar_id":"","url":"https://api.github.com/users/isurulucky","html_url":"https://github.com/isurulucky","followers_url":"https://api.github.com/users/isurulucky/followers","following_url":"https://api.github.com/users/isurulucky/following{/other_user}","gists_url":"https://api.github.com/users/isurulucky/gists{/gist_id}","starred_url":"https://api.github.com/users/isurulucky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/isurulucky/subscriptions","organizations_url":"https://api.github.com/users/isurulucky/orgs","repos_url":"https://api.github.com/users/isurulucky/repos","events_url":"https://api.github.com/users/isurulucky/events{/privacy}","received_events_url":"https://api.github.com/users/isurulucky/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/isurulucky/ballerina","description":"Ballerina is a new programming language for integration built on a sequence diagram metaphor.","fork":true,"url":"https://api.github.com/repos/isurulucky/ballerina","forks_url":"https://api.github.com/repos/isurulucky/ballerina/forks","keys_url":"https://api.github.com/repos/isurulucky/ballerina/keys{/key_id}","collaborators_url":"https://api.github.com/repos/isurulucky/ballerina/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/isurulucky/ballerina/teams","hooks_url":"https://api.github.com/repos/isurulucky/ballerina/hooks","issue_events_url":"https://api.github.com/repos/isurulucky/ballerina/issues/events{/number}","events_url":"https://api.github.com/repos/isurulucky/ballerina/events","assignees_url":"https://api.github.com/repos/isurulucky/ballerina/assignees{/user}","branches_url":"https://api.github.com/repos/isurulucky/ballerina/branches{/branch}","tags_url":"https://api.github.com/repos/isurulucky/ballerina/tags","blobs_url":"https://api.github.com/repos/isurulucky/ballerina/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/isurulucky/ballerina/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/isurulucky/ballerina/git/refs{/sha}","trees_url":"https://api.github.com/repos/isurulucky/ballerina/git/trees{/sha}","statuses_url":"https://api.github.com/repos/isurulucky/ballerina/statuses/{sha}","languages_url":"https://api.github.com/repos/isurulucky/ballerina/languages","stargazers_url":"https://api.github.com/repos/isurulucky/ballerina/stargazers","contributors_url":"https://api.github.com/repos/isurulucky/ballerina/contributors","subscribers_url":"https://api.github.com/repos/isurulucky/ballerina/subscribers","subscription_url":"https://api.github.com/repos/isurulucky/ballerina/subscription","commits_url":"https://api.github.com/repos/isurulucky/ballerina/commits{/sha}","git_commits_url":"https://api.github.com/repos/isurulucky/ballerina/git/commits{/sha}","comments_url":"https://api.github.com/repos/isurulucky/ballerina/comments{/number}","issue_comment_url":"https://api.github.com/repos/isurulucky/ballerina/issues/comments{/number}","contents_url":"https://api.github.com/repos/isurulucky/ballerina/contents/{+path}","compare_url":"https://api.github.com/repos/isurulucky/ballerina/compare/{base}...{head}","merges_url":"https://api.github.com/repos/isurulucky/ballerina/merges","archive_url":"https://api.github.com/repos/isurulucky/ballerina/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/isurulucky/ballerina/downloads","issues_url":"https://api.github.com/repos/isurulucky/ballerina/issues{/number}","pulls_url":"https://api.github.com/repos/isurulucky/ballerina/pulls{/number}","milestones_url":"https://api.github.com/repos/isurulucky/ballerina/milestones{/number}","notifications_url":"https://api.github.com/repos/isurulucky/ballerina/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/isurulucky/ballerina/labels{/name}","releases_url":"https://api.github.com/repos/isurulucky/ballerina/releases{/id}","deployments_url":"https://api.github.com/repos/isurulucky/ballerina/deployments","created_at":"2018-02-23T12:26:33Z","updated_at":"2018-03-17T14:57:45Z","pushed_at":"2018-03-30T09:56:09Z","git_url":"git://github.com/isurulucky/ballerina.git","ssh_url":"git@github.com:isurulucky/ballerina.git","clone_url":"https://github.com/isurulucky/ballerina.git","svn_url":"https://github.com/isurulucky/ballerina","homepage":"","size":194487,"stargazers_count":0,"watchers_count":0,"language":"Java","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":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ballerina-lang:master","ref":"master","sha":"f9b37d2e47b2720466f302240884e1da3f06a029","user":{"login":"ballerina-lang","id":24777199,"avatar_url":"https://avatars1.githubusercontent.com/u/24777199?v=4","gravatar_id":"","url":"https://api.github.com/users/ballerina-lang","html_url":"https://github.com/ballerina-lang","followers_url":"https://api.github.com/users/ballerina-lang/followers","following_url":"https://api.github.com/users/ballerina-lang/following{/other_user}","gists_url":"https://api.github.com/users/ballerina-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/ballerina-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ballerina-lang/subscriptions","organizations_url":"https://api.github.com/users/ballerina-lang/orgs","repos_url":"https://api.github.com/users/ballerina-lang/repos","events_url":"https://api.github.com/users/ballerina-lang/events{/privacy}","received_events_url":"https://api.github.com/users/ballerina-lang/received_events","type":"Organization","site_admin":false},"repo":{"id":73930305,"name":"ballerina","full_name":"ballerina-lang/ballerina","owner":{"login":"ballerina-lang","id":24777199,"avatar_url":"https://avatars1.githubusercontent.com/u/24777199?v=4","gravatar_id":"","url":"https://api.github.com/users/ballerina-lang","html_url":"https://github.com/ballerina-lang","followers_url":"https://api.github.com/users/ballerina-lang/followers","following_url":"https://api.github.com/users/ballerina-lang/following{/other_user}","gists_url":"https://api.github.com/users/ballerina-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/ballerina-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ballerina-lang/subscriptions","organizations_url":"https://api.github.com/users/ballerina-lang/orgs","repos_url":"https://api.github.com/users/ballerina-lang/repos","events_url":"https://api.github.com/users/ballerina-lang/events{/privacy}","received_events_url":"https://api.github.com/users/ballerina-lang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ballerina-lang/ballerina","description":"Ballerina is a new programming language for integration built on a sequence diagram metaphor.","fork":false,"url":"https://api.github.com/repos/ballerina-lang/ballerina","forks_url":"https://api.github.com/repos/ballerina-lang/ballerina/forks","keys_url":"https://api.github.com/repos/ballerina-lang/ballerina/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ballerina-lang/ballerina/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ballerina-lang/ballerina/teams","hooks_url":"https://api.github.com/repos/ballerina-lang/ballerina/hooks","issue_events_url":"https://api.github.com/repos/ballerina-lang/ballerina/issues/events{/number}","events_url":"https://api.github.com/repos/ballerina-lang/ballerina/events","assignees_url":"https://api.github.com/repos/ballerina-lang/ballerina/assignees{/user}","branches_url":"https://api.github.com/repos/ballerina-lang/ballerina/branches{/branch}","tags_url":"https://api.github.com/repos/ballerina-lang/ballerina/tags","blobs_url":"https://api.github.com/repos/ballerina-lang/ballerina/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ballerina-lang/ballerina/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ballerina-lang/ballerina/git/refs{/sha}","trees_url":"https://api.github.com/repos/ballerina-lang/ballerina/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ballerina-lang/ballerina/statuses/{sha}","languages_url":"https://api.github.com/repos/ballerina-lang/ballerina/languages","stargazers_url":"https://api.github.com/repos/ballerina-lang/ballerina/stargazers","contributors_url":"https://api.github.com/repos/ballerina-lang/ballerina/contributors","subscribers_url":"https://api.github.com/repos/ballerina-lang/ballerina/subscribers","subscription_url":"https://api.github.com/repos/ballerina-lang/ballerina/subscription","commits_url":"https://api.github.com/repos/ballerina-lang/ballerina/commits{/sha}","git_commits_url":"https://api.github.com/repos/ballerina-lang/ballerina/git/commits{/sha}","comments_url":"https://api.github.com/repos/ballerina-lang/ballerina/comments{/number}","issue_comment_url":"https://api.github.com/repos/ballerina-lang/ballerina/issues/comments{/number}","contents_url":"https://api.github.com/repos/ballerina-lang/ballerina/contents/{+path}","compare_url":"https://api.github.com/repos/ballerina-lang/ballerina/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ballerina-lang/ballerina/merges","archive_url":"https://api.github.com/repos/ballerina-lang/ballerina/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ballerina-lang/ballerina/downloads","issues_url":"https://api.github.com/repos/ballerina-lang/ballerina/issues{/number}","pulls_url":"https://api.github.com/repos/ballerina-lang/ballerina/pulls{/number}","milestones_url":"https://api.github.com/repos/ballerina-lang/ballerina/milestones{/number}","notifications_url":"https://api.github.com/repos/ballerina-lang/ballerina/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ballerina-lang/ballerina/labels{/name}","releases_url":"https://api.github.com/repos/ballerina-lang/ballerina/releases{/id}","deployments_url":"https://api.github.com/repos/ballerina-lang/ballerina/deployments","created_at":"2016-11-16T14:58:44Z","updated_at":"2018-03-30T11:01:13Z","pushed_at":"2018-03-30T11:24:44Z","git_url":"git://github.com/ballerina-lang/ballerina.git","ssh_url":"git@github.com:ballerina-lang/ballerina.git","clone_url":"https://github.com/ballerina-lang/ballerina.git","svn_url":"https://github.com/ballerina-lang/ballerina","homepage":"","size":194622,"stargazers_count":247,"watchers_count":247,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":275,"mirror_url":null,"archived":false,"open_issues_count":542,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":275,"open_issues":542,"watchers":247,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ballerina-lang/ballerina/pulls/6108"},"html":{"href":"https://github.com/ballerina-lang/ballerina/pull/6108"},"issue":{"href":"https://api.github.com/repos/ballerina-lang/ballerina/issues/6108"},"comments":{"href":"https://api.github.com/repos/ballerina-lang/ballerina/issues/6108/comments"},"review_comments":{"href":"https://api.github.com/repos/ballerina-lang/ballerina/pulls/6108/comments"},"review_comment":{"href":"https://api.github.com/repos/ballerina-lang/ballerina/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ballerina-lang/ballerina/pulls/6108/commits"},"statuses":{"href":"https://api.github.com/repos/ballerina-lang/ballerina/statuses/76df230e1be238d599933c5d632246e9047eb31d"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"pubudu91"}}