namespace Fortran::evaluate {
+int GetSymbolRank(const Symbol *symbol) { return symbol->Rank(); }
+
+const parser::CharBlock &GetSymbolName(const Symbol *symbol) {
+ return symbol->name();
+}
+
// Constructors, accessors, mutators
Triplet::Triplet(std::optional<Expr<SubscriptInteger>> &&l,
#include "type.h"
#include "../common/idioms.h"
#include "../common/template.h"
-#include "../semantics/symbol.h"
#include <optional>
#include <ostream>
#include <variant>
#include <vector>
+namespace Fortran::semantics {
+class Symbol;
+}
+
namespace Fortran::evaluate {
using semantics::Symbol;
using IndirectSubscriptIntegerExpr =
CopyableIndirection<Expr<SubscriptInteger>>;
+int GetSymbolRank(const Symbol *);
+const parser::CharBlock &GetSymbolName(const Symbol *);
+
// R913 structure-component & C920: Defined to be a multi-part
// data-ref whose last part has no subscripts (or image-selector, although
// that isn't explicit in the document). Pointer and allocatable components
int Rank() const {
return std::visit(
- common::visitors{[](const Symbol *sym) { return sym->Rank(); },
+ common::visitors{[](const Symbol *sym) { return GetSymbolRank(sym); },
[](const auto &x) { return x.Rank(); }},
u);
}
std::ostream &Dump(std::ostream &o) const {
std::visit(common::visitors{[&](const Symbol *sym) {
- o << sym->name().ToString();
+ o << GetSymbolName(sym).ToString();
},
[&](const auto &x) { x.Dump(o); }},
u);