{"action":"created","comment":{"url":"https://api.github.com/repos/alexsaveliev/srclib-basic/pulls/comments/48290235","id":48290235,"diff_hunk":"@@ -0,0 +1,113 @@\n+package com.sourcegraph.toolchain.js;\n+\n+import com.sourcegraph.toolchain.core.objects.Def;\n+\n+import java.util.Stack;\n+\n+/**\n+ * Created by iisaev on 17.12.15.\n+ */\n+public class Context {\n+\n+    private Stack<Scope> scopes;\n+\n+    private boolean protoDecl;\n+\n+    private Method curMethod;\n+\n+    private SemaElement resolved;\n+\n+    private Prototype curProtoDecl;\n+\n+    private Prototype proto;\n+\n+    private int anonc;\n+\n+    public String makeAnonScope(String base) {\n+        String res =  base + \"@\" + anonc+ \"@\";\n+        anonc++;\n+        return res;\n+    }\n+\n+    public void setPrototype(Prototype p) {\n+        proto = p;\n+    }\n+\n+    public void unsetPrototype() {\n+        proto = null;\n+    }\n+\n+    public Prototype getPrototype() {\n+        return proto;\n+    }\n+\n+    public void setCurProtoDecl(Prototype p) {\n+        curProtoDecl = p;\n+    }\n+\n+    public Prototype getCurProtoDecl() {\n+        return curProtoDecl;\n+    }\n+\n+    public Context() {\n+        scopes = new Stack<Scope>();\n+        protoDecl = false;\n+        pushScope(\"\"); //global scope\n+    }\n+\n+    public String getName() {\n+        return scopes.peek().getName();\n+    }\n+\n+    public void pushScope(String name) {\n+        Scope s = new Scope(name);\n+        scopes.push(s);\n+    }\n+\n+    public void popScope() {\n+        scopes.pop();\n+    }\n+\n+    public void addToCurrentScope(SemaElement e) {\n+        Scope s = scopes.peek();\n+        s.add(e);\n+    }\n+\n+    public void setProtoDecl() {","path":"toolchain-js/src/main/java/com/sourcegraph/toolchain/js/Context.java","position":76,"original_position":76,"commit_id":"5f761a0288a12993ac1a5365b6fca86bb1fe6ed0","original_commit_id":"5f761a0288a12993ac1a5365b6fca86bb1fe6ed0","user":{"login":"alexsaveliev","id":7010538,"avatar_url":"https://avatars.githubusercontent.com/u/7010538?v=3","gravatar_id":"","url":"https://api.github.com/users/alexsaveliev","html_url":"https://github.com/alexsaveliev","followers_url":"https://api.github.com/users/alexsaveliev/followers","following_url":"https://api.github.com/users/alexsaveliev/following{/other_user}","gists_url":"https://api.github.com/users/alexsaveliev/gists{/gist_id}","starred_url":"https://api.github.com/users/alexsaveliev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexsaveliev/subscriptions","organizations_url":"https://api.github.com/users/alexsaveliev/orgs","repos_url":"https://api.github.com/users/alexsaveliev/repos","events_url":"https://api.github.com/users/alexsaveliev/events{/privacy}","received_events_url":"https://api.github.com/users/alexsaveliev/received_events","type":"User","site_admin":false},"body":"Could you please propose a better name?","created_at":"2015-12-22T19:44:02Z","updated_at":"2015-12-22T19:44:02Z","html_url":"https://github.com/alexsaveliev/srclib-basic/pull/4#discussion_r48290235","pull_request_url":"https://api.github.com/repos/alexsaveliev/srclib-basic/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/alexsaveliev/srclib-basic/pulls/comments/48290235"},"html":{"href":"https://github.com/alexsaveliev/srclib-basic/pull/4#discussion_r48290235"},"pull_request":{"href":"https://api.github.com/repos/alexsaveliev/srclib-basic/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/alexsaveliev/srclib-basic/pulls/4","id":54405667,"html_url":"https://github.com/alexsaveliev/srclib-basic/pull/4","diff_url":"https://github.com/alexsaveliev/srclib-basic/pull/4.diff","patch_url":"https://github.com/alexsaveliev/srclib-basic/pull/4.patch","issue_url":"https://api.github.com/repos/alexsaveliev/srclib-basic/issues/4","number":4,"state":"open","locked":false,"title":"Working prototype for javascript antlr toolchain","user":{"login":"ildarisaev","id":16150737,"avatar_url":"https://avatars.githubusercontent.com/u/16150737?v=3","gravatar_id":"","url":"https://api.github.com/users/ildarisaev","html_url":"https://github.com/ildarisaev","followers_url":"https://api.github.com/users/ildarisaev/followers","following_url":"https://api.github.com/users/ildarisaev/following{/other_user}","gists_url":"https://api.github.com/users/ildarisaev/gists{/gist_id}","starred_url":"https://api.github.com/users/ildarisaev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ildarisaev/subscriptions","organizations_url":"https://api.github.com/users/ildarisaev/orgs","repos_url":"https://api.github.com/users/ildarisaev/repos","events_url":"https://api.github.com/users/ildarisaev/events{/privacy}","received_events_url":"https://api.github.com/users/ildarisaev/received_events","type":"User","site_admin":false},"body":"Work in progress, some cleanup is also definitely needed","created_at":"2015-12-22T19:28:55Z","updated_at":"2015-12-22T19:44:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/alexsaveliev/srclib-basic/pulls/4/commits","review_comments_url":"https://api.github.com/repos/alexsaveliev/srclib-basic/pulls/4/comments","review_comment_url":"https://api.github.com/repos/alexsaveliev/srclib-basic/pulls/comments{/number}","comments_url":"https://api.github.com/repos/alexsaveliev/srclib-basic/issues/4/comments","statuses_url":"https://api.github.com/repos/alexsaveliev/srclib-basic/statuses/5f761a0288a12993ac1a5365b6fca86bb1fe6ed0","head":{"label":"ildarisaev:master","ref":"master","sha":"5f761a0288a12993ac1a5365b6fca86bb1fe6ed0","user":{"login":"ildarisaev","id":16150737,"avatar_url":"https://avatars.githubusercontent.com/u/16150737?v=3","gravatar_id":"","url":"https://api.github.com/users/ildarisaev","html_url":"https://github.com/ildarisaev","followers_url":"https://api.github.com/users/ildarisaev/followers","following_url":"https://api.github.com/users/ildarisaev/following{/other_user}","gists_url":"https://api.github.com/users/ildarisaev/gists{/gist_id}","starred_url":"https://api.github.com/users/ildarisaev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ildarisaev/subscriptions","organizations_url":"https://api.github.com/users/ildarisaev/orgs","repos_url":"https://api.github.com/users/ildarisaev/repos","events_url":"https://api.github.com/users/ildarisaev/events{/privacy}","received_events_url":"https://api.github.com/users/ildarisaev/received_events","type":"User","site_admin":false},"repo":{"id":47400446,"name":"srclib-antlr-1","full_name":"ildarisaev/srclib-antlr-1","owner":{"login":"ildarisaev","id":16150737,"avatar_url":"https://avatars.githubusercontent.com/u/16150737?v=3","gravatar_id":"","url":"https://api.github.com/users/ildarisaev","html_url":"https://github.com/ildarisaev","followers_url":"https://api.github.com/users/ildarisaev/followers","following_url":"https://api.github.com/users/ildarisaev/following{/other_user}","gists_url":"https://api.github.com/users/ildarisaev/gists{/gist_id}","starred_url":"https://api.github.com/users/ildarisaev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ildarisaev/subscriptions","organizations_url":"https://api.github.com/users/ildarisaev/orgs","repos_url":"https://api.github.com/users/ildarisaev/repos","events_url":"https://api.github.com/users/ildarisaev/events{/privacy}","received_events_url":"https://api.github.com/users/ildarisaev/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ildarisaev/srclib-antlr-1","description":"","fork":true,"url":"https://api.github.com/repos/ildarisaev/srclib-antlr-1","forks_url":"https://api.github.com/repos/ildarisaev/srclib-antlr-1/forks","keys_url":"https://api.github.com/repos/ildarisaev/srclib-antlr-1/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ildarisaev/srclib-antlr-1/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ildarisaev/srclib-antlr-1/teams","hooks_url":"https://api.github.com/repos/ildarisaev/srclib-antlr-1/hooks","issue_events_url":"https://api.github.com/repos/ildarisaev/srclib-antlr-1/issues/events{/number}","events_url":"https://api.github.com/repos/ildarisaev/srclib-antlr-1/events","assignees_url":"https://api.github.com/repos/ildarisaev/srclib-antlr-1/assignees{/user}","branches_url":"https://api.github.com/repos/ildarisaev/srclib-antlr-1/branches{/branch}","tags_url":"https://api.github.com/repos/ildarisaev/srclib-antlr-1/tags","blobs_url":"https://api.github.com/repos/ildarisaev/srclib-antlr-1/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ildarisaev/srclib-antlr-1/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ildarisaev/srclib-antlr-1/git/refs{/sha}","trees_url":"https://api.github.com/repos/ildarisaev/srclib-antlr-1/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ildarisaev/srclib-antlr-1/statuses/{sha}","languages_url":"https://api.github.com/repos/ildarisaev/srclib-antlr-1/languages","stargazers_url":"https://api.github.com/repos/ildarisaev/srclib-antlr-1/stargazers","contributors_url":"https://api.github.com/repos/ildarisaev/srclib-antlr-1/contributors","subscribers_url":"https://api.github.com/repos/ildarisaev/srclib-antlr-1/subscribers","subscription_url":"https://api.github.com/repos/ildarisaev/srclib-antlr-1/subscription","commits_url":"https://api.github.com/repos/ildarisaev/srclib-antlr-1/commits{/sha}","git_commits_url":"https://api.github.com/repos/ildarisaev/srclib-antlr-1/git/commits{/sha}","comments_url":"https://api.github.com/repos/ildarisaev/srclib-antlr-1/comments{/number}","issue_comment_url":"https://api.github.com/repos/ildarisaev/srclib-antlr-1/issues/comments{/number}","contents_url":"https://api.github.com/repos/ildarisaev/srclib-antlr-1/contents/{+path}","compare_url":"https://api.github.com/repos/ildarisaev/srclib-antlr-1/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ildarisaev/srclib-antlr-1/merges","archive_url":"https://api.github.com/repos/ildarisaev/srclib-antlr-1/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ildarisaev/srclib-antlr-1/downloads","issues_url":"https://api.github.com/repos/ildarisaev/srclib-antlr-1/issues{/number}","pulls_url":"https://api.github.com/repos/ildarisaev/srclib-antlr-1/pulls{/number}","milestones_url":"https://api.github.com/repos/ildarisaev/srclib-antlr-1/milestones{/number}","notifications_url":"https://api.github.com/repos/ildarisaev/srclib-antlr-1/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ildarisaev/srclib-antlr-1/labels{/name}","releases_url":"https://api.github.com/repos/ildarisaev/srclib-antlr-1/releases{/id}","created_at":"2015-12-04T11:36:53Z","updated_at":"2015-12-04T11:36:54Z","pushed_at":"2015-12-21T17:22:37Z","git_url":"git://github.com/ildarisaev/srclib-antlr-1.git","ssh_url":"git@github.com:ildarisaev/srclib-antlr-1.git","clone_url":"https://github.com/ildarisaev/srclib-antlr-1.git","svn_url":"https://github.com/ildarisaev/srclib-antlr-1","homepage":null,"size":435,"stargazers_count":0,"watchers_count":0,"language":"Java","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":"alexsaveliev:master","ref":"master","sha":"705fe085f776bb4cf995c065b9ac837ca3a485b1","user":{"login":"alexsaveliev","id":7010538,"avatar_url":"https://avatars.githubusercontent.com/u/7010538?v=3","gravatar_id":"","url":"https://api.github.com/users/alexsaveliev","html_url":"https://github.com/alexsaveliev","followers_url":"https://api.github.com/users/alexsaveliev/followers","following_url":"https://api.github.com/users/alexsaveliev/following{/other_user}","gists_url":"https://api.github.com/users/alexsaveliev/gists{/gist_id}","starred_url":"https://api.github.com/users/alexsaveliev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexsaveliev/subscriptions","organizations_url":"https://api.github.com/users/alexsaveliev/orgs","repos_url":"https://api.github.com/users/alexsaveliev/repos","events_url":"https://api.github.com/users/alexsaveliev/events{/privacy}","received_events_url":"https://api.github.com/users/alexsaveliev/received_events","type":"User","site_admin":false},"repo":{"id":46056588,"name":"srclib-basic","full_name":"alexsaveliev/srclib-basic","owner":{"login":"alexsaveliev","id":7010538,"avatar_url":"https://avatars.githubusercontent.com/u/7010538?v=3","gravatar_id":"","url":"https://api.github.com/users/alexsaveliev","html_url":"https://github.com/alexsaveliev","followers_url":"https://api.github.com/users/alexsaveliev/followers","following_url":"https://api.github.com/users/alexsaveliev/following{/other_user}","gists_url":"https://api.github.com/users/alexsaveliev/gists{/gist_id}","starred_url":"https://api.github.com/users/alexsaveliev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexsaveliev/subscriptions","organizations_url":"https://api.github.com/users/alexsaveliev/orgs","repos_url":"https://api.github.com/users/alexsaveliev/repos","events_url":"https://api.github.com/users/alexsaveliev/events{/privacy}","received_events_url":"https://api.github.com/users/alexsaveliev/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/alexsaveliev/srclib-basic","description":"","fork":false,"url":"https://api.github.com/repos/alexsaveliev/srclib-basic","forks_url":"https://api.github.com/repos/alexsaveliev/srclib-basic/forks","keys_url":"https://api.github.com/repos/alexsaveliev/srclib-basic/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alexsaveliev/srclib-basic/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alexsaveliev/srclib-basic/teams","hooks_url":"https://api.github.com/repos/alexsaveliev/srclib-basic/hooks","issue_events_url":"https://api.github.com/repos/alexsaveliev/srclib-basic/issues/events{/number}","events_url":"https://api.github.com/repos/alexsaveliev/srclib-basic/events","assignees_url":"https://api.github.com/repos/alexsaveliev/srclib-basic/assignees{/user}","branches_url":"https://api.github.com/repos/alexsaveliev/srclib-basic/branches{/branch}","tags_url":"https://api.github.com/repos/alexsaveliev/srclib-basic/tags","blobs_url":"https://api.github.com/repos/alexsaveliev/srclib-basic/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alexsaveliev/srclib-basic/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alexsaveliev/srclib-basic/git/refs{/sha}","trees_url":"https://api.github.com/repos/alexsaveliev/srclib-basic/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alexsaveliev/srclib-basic/statuses/{sha}","languages_url":"https://api.github.com/repos/alexsaveliev/srclib-basic/languages","stargazers_url":"https://api.github.com/repos/alexsaveliev/srclib-basic/stargazers","contributors_url":"https://api.github.com/repos/alexsaveliev/srclib-basic/contributors","subscribers_url":"https://api.github.com/repos/alexsaveliev/srclib-basic/subscribers","subscription_url":"https://api.github.com/repos/alexsaveliev/srclib-basic/subscription","commits_url":"https://api.github.com/repos/alexsaveliev/srclib-basic/commits{/sha}","git_commits_url":"https://api.github.com/repos/alexsaveliev/srclib-basic/git/commits{/sha}","comments_url":"https://api.github.com/repos/alexsaveliev/srclib-basic/comments{/number}","issue_comment_url":"https://api.github.com/repos/alexsaveliev/srclib-basic/issues/comments{/number}","contents_url":"https://api.github.com/repos/alexsaveliev/srclib-basic/contents/{+path}","compare_url":"https://api.github.com/repos/alexsaveliev/srclib-basic/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alexsaveliev/srclib-basic/merges","archive_url":"https://api.github.com/repos/alexsaveliev/srclib-basic/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alexsaveliev/srclib-basic/downloads","issues_url":"https://api.github.com/repos/alexsaveliev/srclib-basic/issues{/number}","pulls_url":"https://api.github.com/repos/alexsaveliev/srclib-basic/pulls{/number}","milestones_url":"https://api.github.com/repos/alexsaveliev/srclib-basic/milestones{/number}","notifications_url":"https://api.github.com/repos/alexsaveliev/srclib-basic/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alexsaveliev/srclib-basic/labels{/name}","releases_url":"https://api.github.com/repos/alexsaveliev/srclib-basic/releases{/id}","created_at":"2015-11-12T14:02:26Z","updated_at":"2015-12-14T17:59:03Z","pushed_at":"2015-12-22T19:28:56Z","git_url":"git://github.com/alexsaveliev/srclib-basic.git","ssh_url":"git@github.com:alexsaveliev/srclib-basic.git","clone_url":"https://github.com/alexsaveliev/srclib-basic.git","svn_url":"https://github.com/alexsaveliev/srclib-basic","homepage":null,"size":460,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":2,"forks":3,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/alexsaveliev/srclib-basic/pulls/4"},"html":{"href":"https://github.com/alexsaveliev/srclib-basic/pull/4"},"issue":{"href":"https://api.github.com/repos/alexsaveliev/srclib-basic/issues/4"},"comments":{"href":"https://api.github.com/repos/alexsaveliev/srclib-basic/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/alexsaveliev/srclib-basic/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/alexsaveliev/srclib-basic/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/alexsaveliev/srclib-basic/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/alexsaveliev/srclib-basic/statuses/5f761a0288a12993ac1a5365b6fca86bb1fe6ed0"}}}}