mirror of
https://github.com/ChaiScript/ChaiScript.git
synced 2026-02-06 17:59:56 +08:00
parent
dee2ce5c56
commit
56140608ef
@ -97,7 +97,7 @@ namespace chaiscript {
|
|||||||
template<typename T>
|
template<typename T>
|
||||||
bool contains_var_decl_in_scope(const eval::AST_Node_Impl<T> &node)
|
bool contains_var_decl_in_scope(const eval::AST_Node_Impl<T> &node)
|
||||||
{
|
{
|
||||||
if (node.identifier == AST_Node_Type::Var_Decl || node.identifier == AST_Node_Type::Assign_Decl) {
|
if (node.identifier == AST_Node_Type::Var_Decl || node.identifier == AST_Node_Type::Assign_Decl || node.identifier == AST_Node_Type::Reference) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -107,6 +107,7 @@ namespace chaiscript {
|
|||||||
const auto &child = child_at(node, i);
|
const auto &child = child_at(node, i);
|
||||||
if (child.identifier != AST_Node_Type::Block
|
if (child.identifier != AST_Node_Type::Block
|
||||||
&& child.identifier != AST_Node_Type::For
|
&& child.identifier != AST_Node_Type::For
|
||||||
|
&& child.identifier != AST_Node_Type::Ranged_For
|
||||||
&& contains_var_decl_in_scope(child)) {
|
&& contains_var_decl_in_scope(child)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user