[flang-commits] [flang] [flang] Ignore empty keyword macros before directives (PR #130333)
Peter Klausler via flang-commits
flang-commits at lists.llvm.org
Fri Mar 7 12:14:26 PST 2025
================
@@ -597,6 +595,30 @@ const char *Prescanner::SkipWhiteSpace(const char *p) {
return p;
}
+const char *Prescanner::SkipWhiteSpaceIncludingEmptyMacros(
+ const char *p) const {
+ while (true) {
+ if (int n{IsSpaceOrTab(p)}) {
+ p += n;
+ } else if (preprocessor_.AnyDefinitions() && IsLegalIdentifierStart(*p)) {
+ // Skip keyword macros with empty definitions
+ const char *q{p + 1};
+ while (IsLegalInIdentifier(*q)) {
----------------
klausler wrote:
Yes, and yes. The names `IsLegalIdentifierStart` and `IsLegalInIdentifier` should be clear enough.
https://github.com/llvm/llvm-project/pull/130333
More information about the flang-commits
mailing list