{"action":"created","comment":{"url":"https://api.github.com/repos/java-course-au/kotlin-course/pulls/comments/152376806","pull_request_review_id":78229965,"id":152376806,"diff_hunk":"@@ -0,0 +1,158 @@\n+package ru.spbau.mit.ast\n+\n+/**\n+ * An intermediate AST representation which is built from [org.antlr.v4.runtime.tree.ParseTree].\n+ */\n+data class FunAst(val rootNode: Node) {\n+    interface Node {\n+        fun <T> accept(visitor: FunAstBaseVisitor<T>): T\n+    }\n+\n+    data class File(\n+        val block: Block\n+    ) : Node {\n+        override fun <T> accept(visitor: FunAstBaseVisitor<T>): T {\n+            return visitor.visitFile(this)\n+        }\n+    }\n+\n+    data class Block(\n+        val statements: List<Statement>\n+    ) : Node {\n+        override fun <T> accept(visitor: FunAstBaseVisitor<T>): T {\n+            return visitor.visitBlock(this)\n+        }\n+    }\n+\n+    interface Statement : Node\n+\n+    data class Function(\n+        val identifier: Identifier,\n+        val paramNames: ParameterNames,\n+        val body: Block\n+    ) : Statement {\n+        override fun <T> accept(visitor: FunAstBaseVisitor<T>): T {\n+            return visitor.visitFunction(this)\n+        }\n+    }\n+\n+    data class Variable(\n+        val identifier: Identifier,\n+        val expression: Expression?\n+    ) : Statement {\n+        override fun <T> accept(visitor: FunAstBaseVisitor<T>): T {\n+            return visitor.visitVariable(this)\n+        }\n+    }\n+\n+    data class ParameterNames(\n+        val params: List<Identifier>\n+    ) : Statement {\n+        override fun <T> accept(visitor: FunAstBaseVisitor<T>): T {\n+            return visitor.visitParameterNames(this)\n+        }\n+    }\n+\n+    data class WhileBlock(\n+        val condition: Expression,\n+        val body: Block\n+    ) : Statement {\n+        override fun <T> accept(visitor: FunAstBaseVisitor<T>): T {\n+            return visitor.visitWhileBlock(this)\n+        }\n+    }\n+\n+    data class IfStatement(\n+        val condition: Expression,\n+        val body: Block,\n+        val elseBody: Block?\n+    ) : Statement {\n+        override fun <T> accept(visitor: FunAstBaseVisitor<T>): T {\n+            return visitor.visitIfStatement(this)\n+        }\n+    }\n+\n+    data class Assignment(\n+        val identifier: Identifier,\n+        val expression: Expression\n+    ) : Statement {\n+        override fun <T> accept(visitor: FunAstBaseVisitor<T>): T {\n+            return visitor.visitAssignment(this)\n+        }\n+    }\n+\n+    data class ReturnStatement(\n+        val expression: Expression\n+    ) : Statement {\n+        override fun <T> accept(visitor: FunAstBaseVisitor<T>): T {\n+            return visitor.visitReturnStatement(this)\n+        }\n+    }\n+\n+    data class FunctionCall(\n+        val identifier: Identifier,\n+        val arguments: Arguments\n+    ) : Expression {\n+        override fun <T> accept(visitor: FunAstBaseVisitor<T>): T {\n+            return visitor.visitFunctionCall(this)\n+        }\n+    }\n+\n+    data class Arguments(\n+        val expressions: List<Expression>\n+    ) : Node {\n+        override fun <T> accept(visitor: FunAstBaseVisitor<T>): T {\n+            return visitor.visitArguments(this)\n+        }\n+    }\n+\n+    interface Expression : Statement\n+\n+    data class BinaryExpression(\n+        val leftExpression: Expression,\n+        val operator: Operator,\n+        val rightExpression: Expression\n+    ) : Expression {\n+        override fun <T> accept(visitor: FunAstBaseVisitor<T>): T {\n+            return visitor.visitBinaryExpression(this)\n+        }\n+    }\n+\n+    data class Identifier(\n+        val name: String\n+    ) : Expression {\n+        override fun <T> accept(visitor: FunAstBaseVisitor<T>): T {\n+            return visitor.visitIdentifier(this)\n+        }\n+    }\n+\n+    data class Number(\n+        val literal: String\n+    ) : Expression {\n+        override fun <T> accept(visitor: FunAstBaseVisitor<T>): T {\n+            return visitor.visitNumber(this)\n+        }\n+    }\n+\n+    enum class Operator(val symbol: String) {\n+        MULTIPLY(\"*\"),\n+        DIVIDE(\"/\"),\n+        MODULUS(\"%\"),\n+        PLUS(\"+\"),\n+        MINUS(\"-\"),\n+        GT(\">\"),\n+        LT(\"<\"),\n+        GTE(\">=\"),\n+        LTE(\"<=\"),\n+        EQ(\"==\"),\n+        NQ(\"!=\"),\n+        LOR(\"||\"),\n+        LAND(\"&&\");\n+\n+        companion object {\n+            fun getForSymbol(symbol: String): Operator? {","path":"src/main/java/ru/spbau/mit/ast/FunAst.kt","position":153,"original_position":153,"commit_id":"a3c1e61dab764448c5459ce81ea73ea83ad2afe7","original_commit_id":"a3c1e61dab764448c5459ce81ea73ea83ad2afe7","user":{"login":"niksaz","id":13810812,"avatar_url":"https://avatars3.githubusercontent.com/u/13810812?v=4","gravatar_id":"","url":"https://api.github.com/users/niksaz","html_url":"https://github.com/niksaz","followers_url":"https://api.github.com/users/niksaz/followers","following_url":"https://api.github.com/users/niksaz/following{/other_user}","gists_url":"https://api.github.com/users/niksaz/gists{/gist_id}","starred_url":"https://api.github.com/users/niksaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/niksaz/subscriptions","organizations_url":"https://api.github.com/users/niksaz/orgs","repos_url":"https://api.github.com/users/niksaz/repos","events_url":"https://api.github.com/users/niksaz/events{/privacy}","received_events_url":"https://api.github.com/users/niksaz/received_events","type":"User","site_admin":false},"body":"Спасибо, поправил.","created_at":"2017-11-21T19:23:56Z","updated_at":"2017-11-21T19:23:56Z","html_url":"https://github.com/java-course-au/kotlin-course/pull/43#discussion_r152376806","pull_request_url":"https://api.github.com/repos/java-course-au/kotlin-course/pulls/43","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/java-course-au/kotlin-course/pulls/comments/152376806"},"html":{"href":"https://github.com/java-course-au/kotlin-course/pull/43#discussion_r152376806"},"pull_request":{"href":"https://api.github.com/repos/java-course-au/kotlin-course/pulls/43"}},"in_reply_to_id":152346243},"pull_request":{"url":"https://api.github.com/repos/java-course-au/kotlin-course/pulls/43","id":152060140,"html_url":"https://github.com/java-course-au/kotlin-course/pull/43","diff_url":"https://github.com/java-course-au/kotlin-course/pull/43.diff","patch_url":"https://github.com/java-course-au/kotlin-course/pull/43.patch","issue_url":"https://api.github.com/repos/java-course-au/kotlin-course/issues/43","number":43,"state":"open","locked":false,"title":"Kotlin. ДЗ 02, Сазанович Никита","user":{"login":"niksaz","id":13810812,"avatar_url":"https://avatars3.githubusercontent.com/u/13810812?v=4","gravatar_id":"","url":"https://api.github.com/users/niksaz","html_url":"https://github.com/niksaz","followers_url":"https://api.github.com/users/niksaz/followers","following_url":"https://api.github.com/users/niksaz/following{/other_user}","gists_url":"https://api.github.com/users/niksaz/gists{/gist_id}","starred_url":"https://api.github.com/users/niksaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/niksaz/subscriptions","organizations_url":"https://api.github.com/users/niksaz/orgs","repos_url":"https://api.github.com/users/niksaz/repos","events_url":"https://api.github.com/users/niksaz/events{/privacy}","received_events_url":"https://api.github.com/users/niksaz/received_events","type":"User","site_admin":false},"body":"@dzharkov ","created_at":"2017-11-11T14:53:08Z","updated_at":"2017-11-21T19:23:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1ff9ebdaabeddbad6f308600d5f9e828cf3658e4","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/java-course-au/kotlin-course/pulls/43/commits","review_comments_url":"https://api.github.com/repos/java-course-au/kotlin-course/pulls/43/comments","review_comment_url":"https://api.github.com/repos/java-course-au/kotlin-course/pulls/comments{/number}","comments_url":"https://api.github.com/repos/java-course-au/kotlin-course/issues/43/comments","statuses_url":"https://api.github.com/repos/java-course-au/kotlin-course/statuses/a3c1e61dab764448c5459ce81ea73ea83ad2afe7","head":{"label":"niksaz:02-fun-interpreter","ref":"02-fun-interpreter","sha":"a3c1e61dab764448c5459ce81ea73ea83ad2afe7","user":{"login":"niksaz","id":13810812,"avatar_url":"https://avatars3.githubusercontent.com/u/13810812?v=4","gravatar_id":"","url":"https://api.github.com/users/niksaz","html_url":"https://github.com/niksaz","followers_url":"https://api.github.com/users/niksaz/followers","following_url":"https://api.github.com/users/niksaz/following{/other_user}","gists_url":"https://api.github.com/users/niksaz/gists{/gist_id}","starred_url":"https://api.github.com/users/niksaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/niksaz/subscriptions","organizations_url":"https://api.github.com/users/niksaz/orgs","repos_url":"https://api.github.com/users/niksaz/repos","events_url":"https://api.github.com/users/niksaz/events{/privacy}","received_events_url":"https://api.github.com/users/niksaz/received_events","type":"User","site_admin":false},"repo":{"id":108292547,"name":"kotlin-course","full_name":"niksaz/kotlin-course","owner":{"login":"niksaz","id":13810812,"avatar_url":"https://avatars3.githubusercontent.com/u/13810812?v=4","gravatar_id":"","url":"https://api.github.com/users/niksaz","html_url":"https://github.com/niksaz","followers_url":"https://api.github.com/users/niksaz/followers","following_url":"https://api.github.com/users/niksaz/following{/other_user}","gists_url":"https://api.github.com/users/niksaz/gists{/gist_id}","starred_url":"https://api.github.com/users/niksaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/niksaz/subscriptions","organizations_url":"https://api.github.com/users/niksaz/orgs","repos_url":"https://api.github.com/users/niksaz/repos","events_url":"https://api.github.com/users/niksaz/events{/privacy}","received_events_url":"https://api.github.com/users/niksaz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/niksaz/kotlin-course","description":"Alternative JVM languages course, Fall 2017","fork":true,"url":"https://api.github.com/repos/niksaz/kotlin-course","forks_url":"https://api.github.com/repos/niksaz/kotlin-course/forks","keys_url":"https://api.github.com/repos/niksaz/kotlin-course/keys{/key_id}","collaborators_url":"https://api.github.com/repos/niksaz/kotlin-course/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/niksaz/kotlin-course/teams","hooks_url":"https://api.github.com/repos/niksaz/kotlin-course/hooks","issue_events_url":"https://api.github.com/repos/niksaz/kotlin-course/issues/events{/number}","events_url":"https://api.github.com/repos/niksaz/kotlin-course/events","assignees_url":"https://api.github.com/repos/niksaz/kotlin-course/assignees{/user}","branches_url":"https://api.github.com/repos/niksaz/kotlin-course/branches{/branch}","tags_url":"https://api.github.com/repos/niksaz/kotlin-course/tags","blobs_url":"https://api.github.com/repos/niksaz/kotlin-course/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/niksaz/kotlin-course/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/niksaz/kotlin-course/git/refs{/sha}","trees_url":"https://api.github.com/repos/niksaz/kotlin-course/git/trees{/sha}","statuses_url":"https://api.github.com/repos/niksaz/kotlin-course/statuses/{sha}","languages_url":"https://api.github.com/repos/niksaz/kotlin-course/languages","stargazers_url":"https://api.github.com/repos/niksaz/kotlin-course/stargazers","contributors_url":"https://api.github.com/repos/niksaz/kotlin-course/contributors","subscribers_url":"https://api.github.com/repos/niksaz/kotlin-course/subscribers","subscription_url":"https://api.github.com/repos/niksaz/kotlin-course/subscription","commits_url":"https://api.github.com/repos/niksaz/kotlin-course/commits{/sha}","git_commits_url":"https://api.github.com/repos/niksaz/kotlin-course/git/commits{/sha}","comments_url":"https://api.github.com/repos/niksaz/kotlin-course/comments{/number}","issue_comment_url":"https://api.github.com/repos/niksaz/kotlin-course/issues/comments{/number}","contents_url":"https://api.github.com/repos/niksaz/kotlin-course/contents/{+path}","compare_url":"https://api.github.com/repos/niksaz/kotlin-course/compare/{base}...{head}","merges_url":"https://api.github.com/repos/niksaz/kotlin-course/merges","archive_url":"https://api.github.com/repos/niksaz/kotlin-course/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/niksaz/kotlin-course/downloads","issues_url":"https://api.github.com/repos/niksaz/kotlin-course/issues{/number}","pulls_url":"https://api.github.com/repos/niksaz/kotlin-course/pulls{/number}","milestones_url":"https://api.github.com/repos/niksaz/kotlin-course/milestones{/number}","notifications_url":"https://api.github.com/repos/niksaz/kotlin-course/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/niksaz/kotlin-course/labels{/name}","releases_url":"https://api.github.com/repos/niksaz/kotlin-course/releases{/id}","deployments_url":"https://api.github.com/repos/niksaz/kotlin-course/deployments","created_at":"2017-10-25T15:57:01Z","updated_at":"2017-10-25T16:02:22Z","pushed_at":"2017-11-19T18:05:16Z","git_url":"git://github.com/niksaz/kotlin-course.git","ssh_url":"git@github.com:niksaz/kotlin-course.git","clone_url":"https://github.com/niksaz/kotlin-course.git","svn_url":"https://github.com/niksaz/kotlin-course","homepage":"","size":146,"stargazers_count":0,"watchers_count":0,"language":"Kotlin","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,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"java-course-au:02-fun-interpreter","ref":"02-fun-interpreter","sha":"2a9273f7a4ea210ec24479d082e1fb94154fc4f0","user":{"login":"java-course-au","id":14248092,"avatar_url":"https://avatars1.githubusercontent.com/u/14248092?v=4","gravatar_id":"","url":"https://api.github.com/users/java-course-au","html_url":"https://github.com/java-course-au","followers_url":"https://api.github.com/users/java-course-au/followers","following_url":"https://api.github.com/users/java-course-au/following{/other_user}","gists_url":"https://api.github.com/users/java-course-au/gists{/gist_id}","starred_url":"https://api.github.com/users/java-course-au/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/java-course-au/subscriptions","organizations_url":"https://api.github.com/users/java-course-au/orgs","repos_url":"https://api.github.com/users/java-course-au/repos","events_url":"https://api.github.com/users/java-course-au/events{/privacy}","received_events_url":"https://api.github.com/users/java-course-au/received_events","type":"Organization","site_admin":false},"repo":{"id":107769873,"name":"kotlin-course","full_name":"java-course-au/kotlin-course","owner":{"login":"java-course-au","id":14248092,"avatar_url":"https://avatars1.githubusercontent.com/u/14248092?v=4","gravatar_id":"","url":"https://api.github.com/users/java-course-au","html_url":"https://github.com/java-course-au","followers_url":"https://api.github.com/users/java-course-au/followers","following_url":"https://api.github.com/users/java-course-au/following{/other_user}","gists_url":"https://api.github.com/users/java-course-au/gists{/gist_id}","starred_url":"https://api.github.com/users/java-course-au/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/java-course-au/subscriptions","organizations_url":"https://api.github.com/users/java-course-au/orgs","repos_url":"https://api.github.com/users/java-course-au/repos","events_url":"https://api.github.com/users/java-course-au/events{/privacy}","received_events_url":"https://api.github.com/users/java-course-au/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/java-course-au/kotlin-course","description":null,"fork":false,"url":"https://api.github.com/repos/java-course-au/kotlin-course","forks_url":"https://api.github.com/repos/java-course-au/kotlin-course/forks","keys_url":"https://api.github.com/repos/java-course-au/kotlin-course/keys{/key_id}","collaborators_url":"https://api.github.com/repos/java-course-au/kotlin-course/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/java-course-au/kotlin-course/teams","hooks_url":"https://api.github.com/repos/java-course-au/kotlin-course/hooks","issue_events_url":"https://api.github.com/repos/java-course-au/kotlin-course/issues/events{/number}","events_url":"https://api.github.com/repos/java-course-au/kotlin-course/events","assignees_url":"https://api.github.com/repos/java-course-au/kotlin-course/assignees{/user}","branches_url":"https://api.github.com/repos/java-course-au/kotlin-course/branches{/branch}","tags_url":"https://api.github.com/repos/java-course-au/kotlin-course/tags","blobs_url":"https://api.github.com/repos/java-course-au/kotlin-course/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/java-course-au/kotlin-course/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/java-course-au/kotlin-course/git/refs{/sha}","trees_url":"https://api.github.com/repos/java-course-au/kotlin-course/git/trees{/sha}","statuses_url":"https://api.github.com/repos/java-course-au/kotlin-course/statuses/{sha}","languages_url":"https://api.github.com/repos/java-course-au/kotlin-course/languages","stargazers_url":"https://api.github.com/repos/java-course-au/kotlin-course/stargazers","contributors_url":"https://api.github.com/repos/java-course-au/kotlin-course/contributors","subscribers_url":"https://api.github.com/repos/java-course-au/kotlin-course/subscribers","subscription_url":"https://api.github.com/repos/java-course-au/kotlin-course/subscription","commits_url":"https://api.github.com/repos/java-course-au/kotlin-course/commits{/sha}","git_commits_url":"https://api.github.com/repos/java-course-au/kotlin-course/git/commits{/sha}","comments_url":"https://api.github.com/repos/java-course-au/kotlin-course/comments{/number}","issue_comment_url":"https://api.github.com/repos/java-course-au/kotlin-course/issues/comments{/number}","contents_url":"https://api.github.com/repos/java-course-au/kotlin-course/contents/{+path}","compare_url":"https://api.github.com/repos/java-course-au/kotlin-course/compare/{base}...{head}","merges_url":"https://api.github.com/repos/java-course-au/kotlin-course/merges","archive_url":"https://api.github.com/repos/java-course-au/kotlin-course/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/java-course-au/kotlin-course/downloads","issues_url":"https://api.github.com/repos/java-course-au/kotlin-course/issues{/number}","pulls_url":"https://api.github.com/repos/java-course-au/kotlin-course/pulls{/number}","milestones_url":"https://api.github.com/repos/java-course-au/kotlin-course/milestones{/number}","notifications_url":"https://api.github.com/repos/java-course-au/kotlin-course/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/java-course-au/kotlin-course/labels{/name}","releases_url":"https://api.github.com/repos/java-course-au/kotlin-course/releases{/id}","deployments_url":"https://api.github.com/repos/java-course-au/kotlin-course/deployments","created_at":"2017-10-21T10:05:04Z","updated_at":"2017-10-21T12:02:33Z","pushed_at":"2017-11-20T20:34:55Z","git_url":"git://github.com/java-course-au/kotlin-course.git","ssh_url":"git@github.com:java-course-au/kotlin-course.git","clone_url":"https://github.com/java-course-au/kotlin-course.git","svn_url":"https://github.com/java-course-au/kotlin-course","homepage":null,"size":68,"stargazers_count":0,"watchers_count":0,"language":"Kotlin","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":31,"mirror_url":null,"archived":false,"open_issues_count":56,"forks":31,"open_issues":56,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/java-course-au/kotlin-course/pulls/43"},"html":{"href":"https://github.com/java-course-au/kotlin-course/pull/43"},"issue":{"href":"https://api.github.com/repos/java-course-au/kotlin-course/issues/43"},"comments":{"href":"https://api.github.com/repos/java-course-au/kotlin-course/issues/43/comments"},"review_comments":{"href":"https://api.github.com/repos/java-course-au/kotlin-course/pulls/43/comments"},"review_comment":{"href":"https://api.github.com/repos/java-course-au/kotlin-course/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/java-course-au/kotlin-course/pulls/43/commits"},"statuses":{"href":"https://api.github.com/repos/java-course-au/kotlin-course/statuses/a3c1e61dab764448c5459ce81ea73ea83ad2afe7"}},"author_association":"NONE"}}
{"actor":{"display_login":"niksaz"}}