{"action":"created","comment":{"url":"https://api.github.com/repos/stan-dev/stan/pulls/comments/187812071","pull_request_review_id":119665328,"id":187812071,"diff_hunk":"@@ -0,0 +1,108 @@\n+#ifndef STAN_LANG_AST_FUN_IS_ARRAY_TYPE_VIS_DEF_HPP\n+#define STAN_LANG_AST_FUN_IS_ARRAY_TYPE_VIS_DEF_HPP\n+\n+#include <stan/lang/ast.hpp>\n+#include <boost/variant/apply_visitor.hpp>\n+\n+namespace stan {\n+namespace lang {\n+is_array_type_vis::is_array_type_vis() {}","path":"src/stan/lang/ast/fun/is_array_type_vis_def.hpp","position":9,"original_position":9,"commit_id":"e3b862cef438a46f9a8c865c1626ac97dd015359","original_commit_id":"e3b862cef438a46f9a8c865c1626ac97dd015359","user":{"login":"mitzimorris","id":5466612,"avatar_url":"https://avatars1.githubusercontent.com/u/5466612?v=4","gravatar_id":"","url":"https://api.github.com/users/mitzimorris","html_url":"https://github.com/mitzimorris","followers_url":"https://api.github.com/users/mitzimorris/followers","following_url":"https://api.github.com/users/mitzimorris/following{/other_user}","gists_url":"https://api.github.com/users/mitzimorris/gists{/gist_id}","starred_url":"https://api.github.com/users/mitzimorris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mitzimorris/subscriptions","organizations_url":"https://api.github.com/users/mitzimorris/orgs","repos_url":"https://api.github.com/users/mitzimorris/repos","events_url":"https://api.github.com/users/mitzimorris/events{/privacy}","received_events_url":"https://api.github.com/users/mitzimorris/received_events","type":"User","site_admin":false},"body":"this function doesn't need a visitor at all - can be defined as:\r\n ```\r\nthis->array_dims() > 0\r\n```\r\neliminates visitor function.  similar logic applies to `block_var_type` function `has_def_bounds`.","created_at":"2018-05-13T20:06:01Z","updated_at":"2018-05-13T20:06:02Z","html_url":"https://github.com/stan-dev/stan/pull/2498#discussion_r187812071","pull_request_url":"https://api.github.com/repos/stan-dev/stan/pulls/2498","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/stan-dev/stan/pulls/comments/187812071"},"html":{"href":"https://github.com/stan-dev/stan/pull/2498#discussion_r187812071"},"pull_request":{"href":"https://api.github.com/repos/stan-dev/stan/pulls/2498"}},"in_reply_to_id":186300143},"pull_request":{"url":"https://api.github.com/repos/stan-dev/stan/pulls/2498","id":177334410,"html_url":"https://github.com/stan-dev/stan/pull/2498","diff_url":"https://github.com/stan-dev/stan/pull/2498.diff","patch_url":"https://github.com/stan-dev/stan/pull/2498.patch","issue_url":"https://api.github.com/repos/stan-dev/stan/issues/2498","number":2498,"state":"open","locked":false,"title":"Feature/2431 lang tuples step1","user":{"login":"mitzimorris","id":5466612,"avatar_url":"https://avatars1.githubusercontent.com/u/5466612?v=4","gravatar_id":"","url":"https://api.github.com/users/mitzimorris","html_url":"https://github.com/mitzimorris","followers_url":"https://api.github.com/users/mitzimorris/followers","following_url":"https://api.github.com/users/mitzimorris/following{/other_user}","gists_url":"https://api.github.com/users/mitzimorris/gists{/gist_id}","starred_url":"https://api.github.com/users/mitzimorris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mitzimorris/subscriptions","organizations_url":"https://api.github.com/users/mitzimorris/orgs","repos_url":"https://api.github.com/users/mitzimorris/repos","events_url":"https://api.github.com/users/mitzimorris/events{/privacy}","received_events_url":"https://api.github.com/users/mitzimorris/received_events","type":"User","site_admin":false},"body":"#### Submission Checklist\r\n\r\n- [x] Run unit tests: `./runTests.py src/test/unit`\r\n- [x] Run cpplint: `make cpplint`\r\n- [x] Declare copyright holder and open-source license: see below\r\n\r\n#### Summary\r\nRefactor of stan/lang AST needed in order to extend Stan language to tuples.  See issue #2431 for details.\r\n\r\n#### Intended Effect\r\nEverything should work exactly as before.\r\n\r\n#### How to Verify\r\nRun all unit tests.\r\n\r\n#### Side Effects\r\nChanges to the AST nodes required changes to the generator code.  Previously the AST contained a set of variant types for variable declarations, with the result that the generator code required many vistor classes to generate the series of c++ statements which correspond to a single Stan language variable declaration or compound declaration-definition.   In rewriting the generator methods, I changed the generated code itself in order to remove duplicate checks on container sizes and improve overall readability.  Significant changes to the generated code:\r\n\r\n1.  Previously first all variable dimensions were validated, then variables were initialized.  Now validation is followed directly by initialization, which means that some failing programs may fail differently.\r\n\r\n2. Double literal variables now store the actual string value from the program.  Previously, generated c++ code used the stored double value, e.g.  double literal \"5.1\"  would be initialized to not exactly 5.1, depending on the compiler.  Now the string value \"5.1\" is generated.\r\n\r\n3. spaces after commas in args, to improve readibility.\r\n\r\n#### Documentation\r\nN/A.\r\n\r\n#### Copyright and Licensing\r\n\r\nPlease list the copyright holder for the work you are submitting (this will be you or your assignee, such as a university or company): Columbia University\r\n\r\n\r\n\r\n\r\nBy submitting this pull request, the copyright holder is agreeing to license the submitted work under the following licenses:\r\n- Code: BSD 3-clause (https://opensource.org/licenses/BSD-3-Clause)\r\n- Documentation: CC-BY 4.0 (https://creativecommons.org/licenses/by/4.0/)\r\n","created_at":"2018-03-26T03:24:41Z","updated_at":"2018-05-13T20:06:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"55a294330d78e9173f620ee019621d7eabd966ed","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/stan-dev/stan/pulls/2498/commits","review_comments_url":"https://api.github.com/repos/stan-dev/stan/pulls/2498/comments","review_comment_url":"https://api.github.com/repos/stan-dev/stan/pulls/comments{/number}","comments_url":"https://api.github.com/repos/stan-dev/stan/issues/2498/comments","statuses_url":"https://api.github.com/repos/stan-dev/stan/statuses/e3b862cef438a46f9a8c865c1626ac97dd015359","head":{"label":"stan-dev:feature/2431-lang-tuples-step1","ref":"feature/2431-lang-tuples-step1","sha":"e3b862cef438a46f9a8c865c1626ac97dd015359","user":{"login":"stan-dev","id":3374820,"avatar_url":"https://avatars2.githubusercontent.com/u/3374820?v=4","gravatar_id":"","url":"https://api.github.com/users/stan-dev","html_url":"https://github.com/stan-dev","followers_url":"https://api.github.com/users/stan-dev/followers","following_url":"https://api.github.com/users/stan-dev/following{/other_user}","gists_url":"https://api.github.com/users/stan-dev/gists{/gist_id}","starred_url":"https://api.github.com/users/stan-dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stan-dev/subscriptions","organizations_url":"https://api.github.com/users/stan-dev/orgs","repos_url":"https://api.github.com/users/stan-dev/repos","events_url":"https://api.github.com/users/stan-dev/events{/privacy}","received_events_url":"https://api.github.com/users/stan-dev/received_events","type":"Organization","site_admin":false},"repo":{"id":8043756,"name":"stan","full_name":"stan-dev/stan","owner":{"login":"stan-dev","id":3374820,"avatar_url":"https://avatars2.githubusercontent.com/u/3374820?v=4","gravatar_id":"","url":"https://api.github.com/users/stan-dev","html_url":"https://github.com/stan-dev","followers_url":"https://api.github.com/users/stan-dev/followers","following_url":"https://api.github.com/users/stan-dev/following{/other_user}","gists_url":"https://api.github.com/users/stan-dev/gists{/gist_id}","starred_url":"https://api.github.com/users/stan-dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stan-dev/subscriptions","organizations_url":"https://api.github.com/users/stan-dev/orgs","repos_url":"https://api.github.com/users/stan-dev/repos","events_url":"https://api.github.com/users/stan-dev/events{/privacy}","received_events_url":"https://api.github.com/users/stan-dev/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/stan-dev/stan","description":"Stan development repository (home page is linked below). The master branch contains the current release. The develop branch contains the latest stable development.  See the Developer Process Wiki for details.  ","fork":false,"url":"https://api.github.com/repos/stan-dev/stan","forks_url":"https://api.github.com/repos/stan-dev/stan/forks","keys_url":"https://api.github.com/repos/stan-dev/stan/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stan-dev/stan/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stan-dev/stan/teams","hooks_url":"https://api.github.com/repos/stan-dev/stan/hooks","issue_events_url":"https://api.github.com/repos/stan-dev/stan/issues/events{/number}","events_url":"https://api.github.com/repos/stan-dev/stan/events","assignees_url":"https://api.github.com/repos/stan-dev/stan/assignees{/user}","branches_url":"https://api.github.com/repos/stan-dev/stan/branches{/branch}","tags_url":"https://api.github.com/repos/stan-dev/stan/tags","blobs_url":"https://api.github.com/repos/stan-dev/stan/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stan-dev/stan/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stan-dev/stan/git/refs{/sha}","trees_url":"https://api.github.com/repos/stan-dev/stan/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stan-dev/stan/statuses/{sha}","languages_url":"https://api.github.com/repos/stan-dev/stan/languages","stargazers_url":"https://api.github.com/repos/stan-dev/stan/stargazers","contributors_url":"https://api.github.com/repos/stan-dev/stan/contributors","subscribers_url":"https://api.github.com/repos/stan-dev/stan/subscribers","subscription_url":"https://api.github.com/repos/stan-dev/stan/subscription","commits_url":"https://api.github.com/repos/stan-dev/stan/commits{/sha}","git_commits_url":"https://api.github.com/repos/stan-dev/stan/git/commits{/sha}","comments_url":"https://api.github.com/repos/stan-dev/stan/comments{/number}","issue_comment_url":"https://api.github.com/repos/stan-dev/stan/issues/comments{/number}","contents_url":"https://api.github.com/repos/stan-dev/stan/contents/{+path}","compare_url":"https://api.github.com/repos/stan-dev/stan/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stan-dev/stan/merges","archive_url":"https://api.github.com/repos/stan-dev/stan/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stan-dev/stan/downloads","issues_url":"https://api.github.com/repos/stan-dev/stan/issues{/number}","pulls_url":"https://api.github.com/repos/stan-dev/stan/pulls{/number}","milestones_url":"https://api.github.com/repos/stan-dev/stan/milestones{/number}","notifications_url":"https://api.github.com/repos/stan-dev/stan/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stan-dev/stan/labels{/name}","releases_url":"https://api.github.com/repos/stan-dev/stan/releases{/id}","deployments_url":"https://api.github.com/repos/stan-dev/stan/deployments","created_at":"2013-02-06T03:25:04Z","updated_at":"2018-05-13T17:09:04Z","pushed_at":"2018-05-10T23:14:17Z","git_url":"git://github.com/stan-dev/stan.git","ssh_url":"git@github.com:stan-dev/stan.git","clone_url":"https://github.com/stan-dev/stan.git","svn_url":"https://github.com/stan-dev/stan","homepage":"http://mc-stan.org","size":265337,"stargazers_count":1238,"watchers_count":1238,"language":"R","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":233,"mirror_url":null,"archived":false,"open_issues_count":208,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause"},"forks":233,"open_issues":208,"watchers":1238,"default_branch":"develop"}},"base":{"label":"stan-dev:develop","ref":"develop","sha":"db7656fef5455733490341b0ee236ce97a72ecbe","user":{"login":"stan-dev","id":3374820,"avatar_url":"https://avatars2.githubusercontent.com/u/3374820?v=4","gravatar_id":"","url":"https://api.github.com/users/stan-dev","html_url":"https://github.com/stan-dev","followers_url":"https://api.github.com/users/stan-dev/followers","following_url":"https://api.github.com/users/stan-dev/following{/other_user}","gists_url":"https://api.github.com/users/stan-dev/gists{/gist_id}","starred_url":"https://api.github.com/users/stan-dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stan-dev/subscriptions","organizations_url":"https://api.github.com/users/stan-dev/orgs","repos_url":"https://api.github.com/users/stan-dev/repos","events_url":"https://api.github.com/users/stan-dev/events{/privacy}","received_events_url":"https://api.github.com/users/stan-dev/received_events","type":"Organization","site_admin":false},"repo":{"id":8043756,"name":"stan","full_name":"stan-dev/stan","owner":{"login":"stan-dev","id":3374820,"avatar_url":"https://avatars2.githubusercontent.com/u/3374820?v=4","gravatar_id":"","url":"https://api.github.com/users/stan-dev","html_url":"https://github.com/stan-dev","followers_url":"https://api.github.com/users/stan-dev/followers","following_url":"https://api.github.com/users/stan-dev/following{/other_user}","gists_url":"https://api.github.com/users/stan-dev/gists{/gist_id}","starred_url":"https://api.github.com/users/stan-dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stan-dev/subscriptions","organizations_url":"https://api.github.com/users/stan-dev/orgs","repos_url":"https://api.github.com/users/stan-dev/repos","events_url":"https://api.github.com/users/stan-dev/events{/privacy}","received_events_url":"https://api.github.com/users/stan-dev/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/stan-dev/stan","description":"Stan development repository (home page is linked below). The master branch contains the current release. The develop branch contains the latest stable development.  See the Developer Process Wiki for details.  ","fork":false,"url":"https://api.github.com/repos/stan-dev/stan","forks_url":"https://api.github.com/repos/stan-dev/stan/forks","keys_url":"https://api.github.com/repos/stan-dev/stan/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stan-dev/stan/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stan-dev/stan/teams","hooks_url":"https://api.github.com/repos/stan-dev/stan/hooks","issue_events_url":"https://api.github.com/repos/stan-dev/stan/issues/events{/number}","events_url":"https://api.github.com/repos/stan-dev/stan/events","assignees_url":"https://api.github.com/repos/stan-dev/stan/assignees{/user}","branches_url":"https://api.github.com/repos/stan-dev/stan/branches{/branch}","tags_url":"https://api.github.com/repos/stan-dev/stan/tags","blobs_url":"https://api.github.com/repos/stan-dev/stan/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stan-dev/stan/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stan-dev/stan/git/refs{/sha}","trees_url":"https://api.github.com/repos/stan-dev/stan/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stan-dev/stan/statuses/{sha}","languages_url":"https://api.github.com/repos/stan-dev/stan/languages","stargazers_url":"https://api.github.com/repos/stan-dev/stan/stargazers","contributors_url":"https://api.github.com/repos/stan-dev/stan/contributors","subscribers_url":"https://api.github.com/repos/stan-dev/stan/subscribers","subscription_url":"https://api.github.com/repos/stan-dev/stan/subscription","commits_url":"https://api.github.com/repos/stan-dev/stan/commits{/sha}","git_commits_url":"https://api.github.com/repos/stan-dev/stan/git/commits{/sha}","comments_url":"https://api.github.com/repos/stan-dev/stan/comments{/number}","issue_comment_url":"https://api.github.com/repos/stan-dev/stan/issues/comments{/number}","contents_url":"https://api.github.com/repos/stan-dev/stan/contents/{+path}","compare_url":"https://api.github.com/repos/stan-dev/stan/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stan-dev/stan/merges","archive_url":"https://api.github.com/repos/stan-dev/stan/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stan-dev/stan/downloads","issues_url":"https://api.github.com/repos/stan-dev/stan/issues{/number}","pulls_url":"https://api.github.com/repos/stan-dev/stan/pulls{/number}","milestones_url":"https://api.github.com/repos/stan-dev/stan/milestones{/number}","notifications_url":"https://api.github.com/repos/stan-dev/stan/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stan-dev/stan/labels{/name}","releases_url":"https://api.github.com/repos/stan-dev/stan/releases{/id}","deployments_url":"https://api.github.com/repos/stan-dev/stan/deployments","created_at":"2013-02-06T03:25:04Z","updated_at":"2018-05-13T17:09:04Z","pushed_at":"2018-05-10T23:14:17Z","git_url":"git://github.com/stan-dev/stan.git","ssh_url":"git@github.com:stan-dev/stan.git","clone_url":"https://github.com/stan-dev/stan.git","svn_url":"https://github.com/stan-dev/stan","homepage":"http://mc-stan.org","size":265337,"stargazers_count":1238,"watchers_count":1238,"language":"R","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":233,"mirror_url":null,"archived":false,"open_issues_count":208,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause"},"forks":233,"open_issues":208,"watchers":1238,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/stan-dev/stan/pulls/2498"},"html":{"href":"https://github.com/stan-dev/stan/pull/2498"},"issue":{"href":"https://api.github.com/repos/stan-dev/stan/issues/2498"},"comments":{"href":"https://api.github.com/repos/stan-dev/stan/issues/2498/comments"},"review_comments":{"href":"https://api.github.com/repos/stan-dev/stan/pulls/2498/comments"},"review_comment":{"href":"https://api.github.com/repos/stan-dev/stan/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/stan-dev/stan/pulls/2498/commits"},"statuses":{"href":"https://api.github.com/repos/stan-dev/stan/statuses/e3b862cef438a46f9a8c865c1626ac97dd015359"}},"author_association":"OWNER"}}
{"actor":{"display_login":"mitzimorris"}}