[flang-commits] [flang] [flang] Refine tokenization trick that hid macro name (PR #121990)

Eugene Epshteyn via flang-commits flang-commits at lists.llvm.org
Wed Jan 8 18:08:37 PST 2025


================
@@ -709,9 +709,22 @@ bool Prescanner::NextToken(TokenSequence &tokens) {
       QuotedCharacterLiteral(tokens, start);
     } else if (IsLetter(*at_) && !preventHollerith_ &&
         parenthesisNesting_ > 0) {
-      // Handles FORMAT(3I9HHOLLERITH) by skipping over the first I so that
-      // we don't misrecognize I9HOLLERITH as an identifier in the next case.
-      EmitCharAndAdvance(tokens, *at_);
+      const char *p{at_};
+      int digits{0};
+      for (;; ++digits) {
+        ++p;
+        if (InFixedFormSource()) {
+          p = SkipWhiteSpace(p);
----------------
eugeneepshteyn wrote:

(Ghithub had issues. My comment was meant for line 715 `++p`.)

https://github.com/llvm/llvm-project/pull/121990


More information about the flang-commits mailing list