@@ -150,19 +150,18 @@ class SemanticsContext {
150150 }
151151 void PopConstruct ();
152152
153- // Check to see if a variable being redefined is a DO variable. If so, emit
154- // a message
155- void WarnDoVarRedefine ( const parser::CharBlock &, const Symbol &);
156- void CheckDoVarRedefine (const parser::CharBlock &, const Symbol &);
157- void CheckDoVarRedefine (const parser::Variable &);
158- void CheckDoVarRedefine (const parser::Name &);
159- void ActivateDoVariable (const parser::Name &);
160- void DeactivateDoVariable (const parser::Name &);
161- bool IsActiveDoVariable (const Symbol &);
153+ ENUM_CLASS (IndexVarKind, DO, FORALL)
154+ // Check to see if a variable being redefined is a DO or FORALL index.
155+ // If so, emit a message.
156+ void WarnIndexVarRedefine (const parser::CharBlock &, const Symbol &);
157+ void CheckIndexVarRedefine (const parser::CharBlock &, const Symbol &);
158+ void CheckIndexVarRedefine (const parser::Variable &);
159+ void CheckIndexVarRedefine (const parser::Name &);
160+ void ActivateIndexVar (const parser::Name &, IndexVarKind );
161+ void DeactivateIndexVar (const parser::Name &);
162162
163163private:
164- parser::CharBlock GetDoVariableLocation (const Symbol &);
165- void CheckDoVarRedefine (
164+ void CheckIndexVarRedefine (
166165 const parser::CharBlock &, const Symbol &, parser::MessageFixedText &&);
167166 const common::IntrinsicTypeDefaultKinds &defaultKinds_;
168167 const common::LanguageFeatureControl languageFeatures_;
@@ -180,7 +179,11 @@ class SemanticsContext {
180179
181180 bool CheckError (bool );
182181 ConstructStack constructStack_;
183- std::map<SymbolRef, const parser::CharBlock> activeDoVariables_;
182+ struct IndexVarInfo {
183+ parser::CharBlock location;
184+ IndexVarKind kind;
185+ };
186+ std::map<SymbolRef, const IndexVarInfo> activeIndexVars_;
184187};
185188
186189class Semantics {
0 commit comments