forked from OSchip/llvm-project
[flang] Start on f90_correct. Incorporate review comments.
Original-commit: flang-compiler/f18@3f8cecef8e Reviewed-on: https://github.com/flang-compiler/f18/pull/25 Tree-same-pre-rewrite: false
This commit is contained in:
parent
47dbbda25d
commit
d39a33f80c
|
@ -58,11 +58,11 @@ std::optional<size_t> CountCharacters(
|
|||
const char *limit{p + bytes};
|
||||
while (p < limit) {
|
||||
++chars;
|
||||
if (std::optional<int> cb{cbf(p)}) {
|
||||
p += *cb;
|
||||
} else {
|
||||
std::optional<int> cb{cbf(p)};
|
||||
if (!cb.has_value()) {
|
||||
return {};
|
||||
}
|
||||
p += *cb;
|
||||
}
|
||||
return {chars};
|
||||
}
|
||||
|
|
|
@ -435,6 +435,18 @@ public:
|
|||
Put(' '), Walk(std::get<std::list<EntityDecl>>(x.t), ", ");
|
||||
return false;
|
||||
}
|
||||
bool Pre(const AttrSpec &x) { // R802
|
||||
std::visit(visitors{[&](const CoarraySpec &y) { Put("CODIMENSION["); },
|
||||
[&](const ArraySpec &y) { Put("DIMENSION("); },
|
||||
[&](const auto &) {}},
|
||||
x.u);
|
||||
return true;
|
||||
}
|
||||
void Post(const AttrSpec &x) {
|
||||
std::visit(visitors{[&](const CoarraySpec &y) { Put(']'); },
|
||||
[&](const ArraySpec &y) { Put(')'); }, [&](const auto &) {}},
|
||||
x.u);
|
||||
}
|
||||
bool Pre(const EntityDecl &x) { // R803
|
||||
Walk(std::get<ObjectName>(x.t));
|
||||
Walk("(", std::get<std::optional<ArraySpec>>(x.t), ")");
|
||||
|
|
Loading…
Reference in New Issue