Skip to content

Commit

Permalink
changes per code review
Browse files Browse the repository at this point in the history
  • Loading branch information
mitzimorris committed Nov 17, 2017
1 parent a66ff2a commit e8079ff
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
7 changes: 4 additions & 3 deletions src/stan/lang/ast/scope.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,10 @@ namespace stan {
bool is_local() const;

/**
* Flags local scopes which permit parameter variables,
* i.e., program block can't be transformed data or
* generated quantities program blocks.
* Flags local scopes which permit parameter variables.
* Allows local blocks in functions, transfromed parameter,
* and model blocks; disallows local blocks in transformed data
* and generated quantities program blocks.
*
* @return true for local parameter origin block types
*/
Expand Down
6 changes: 3 additions & 3 deletions src/stan/lang/ast/scope_def.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ namespace stan {
}

bool scope::local_allows_var() const {
return is_local_ &&
!(program_block_ == transformed_data_origin
|| program_block_ == derived_origin);
return is_local_
&& program_block_ != transformed_data_origin
&& program_block_ != derived_origin;
}

bool scope::par_or_tpar() const {
Expand Down

0 comments on commit e8079ff

Please sign in to comment.