[flang-commits] [PATCH] D124278: [flang][runtime] Ignore leading spaces even in BZ mode

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Fri Apr 22 12:32:40 PDT 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rGcbbc66290044: [flang][runtime] Ignore leading spaces even in BZ mode (authored by klausler).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D124278/new/

https://reviews.llvm.org/D124278

Files:
  flang/runtime/edit-input.cpp
  flang/runtime/io-stmt.h


Index: flang/runtime/io-stmt.h
===================================================================
--- flang/runtime/io-stmt.h
+++ flang/runtime/io-stmt.h
@@ -133,8 +133,8 @@
   // For fixed-width fields, initialize the number of remaining characters.
   // Skip over leading blanks, then return the first non-blank character (if
   // any).
-  std::optional<char32_t> PrepareInput(const DataEdit &edit,
-      std::optional<int> &remaining, bool skipSpaces = true) {
+  std::optional<char32_t> PrepareInput(
+      const DataEdit &edit, std::optional<int> &remaining) {
     remaining.reset();
     if (edit.descriptor == DataEdit::ListDirected) {
       std::size_t byteCount{0};
@@ -143,9 +143,7 @@
       if (edit.width.value_or(0) > 0) {
         remaining = *edit.width;
       }
-      if (skipSpaces) {
-        SkipSpaces(remaining);
-      }
+      SkipSpaces(remaining);
     }
     return NextInField(remaining, edit);
   }
Index: flang/runtime/edit-input.cpp
===================================================================
--- flang/runtime/edit-input.cpp
+++ flang/runtime/edit-input.cpp
@@ -58,15 +58,12 @@
 // Returns true if there's a '-' sign.
 static bool ScanNumericPrefix(IoStatementState &io, const DataEdit &edit,
     std::optional<char32_t> &next, std::optional<int> &remaining) {
-  bool bzMode{(edit.modes.editingFlags & blankZero) != 0};
-  next = io.PrepareInput(edit, remaining, !bzMode);
+  next = io.PrepareInput(edit, remaining);
   bool negative{false};
   if (next) {
     negative = *next == '-';
     if (negative || *next == '+') {
-      if (!bzMode) {
-        io.SkipSpaces(remaining);
-      }
+      io.SkipSpaces(remaining);
       next = io.NextInField(remaining, edit);
     }
   }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D124278.424575.patch
Type: text/x-patch
Size: 1732 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20220422/8162d3bd/attachment.bin>


More information about the flang-commits mailing list