[flang-commits] [PATCH] D112350: [flang] Extension: allow tabs in output format strings

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Fri Oct 22 15:56:10 PDT 2021


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGfbb020fb48be: [flang] Extension: allow tabs in output format strings (authored by klausler).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112350

Files:
  flang/docs/Extensions.md
  flang/runtime/format-implementation.h


Index: flang/runtime/format-implementation.h
===================================================================
--- flang/runtime/format-implementation.h
+++ flang/runtime/format-implementation.h
@@ -359,6 +359,10 @@
       context.AdvanceRecord(repeat && *repeat > 0 ? *repeat : 1);
     } else if (ch == '$' || ch == '\\') {
       context.mutableModes().nonAdvancing = true;
+    } else if (ch == '\t' || ch == '\v') {
+      // Tabs (extension)
+      // TODO: any other raw characters?
+      context.Emit(format_ + offset_ - 1, 1);
     } else {
       context.SignalError(IostatErrorInFormat,
           "Invalid character '%c' in FORMAT", static_cast<char>(ch));
Index: flang/docs/Extensions.md
===================================================================
--- flang/docs/Extensions.md
+++ flang/docs/Extensions.md
@@ -122,6 +122,7 @@
   files are easier to write and use.
 * $ and \ edit descriptors are supported in FORMAT to suppress newline
   output on user prompts.
+* Tabs in format strings (not `FORMAT` statements) are allowed on output.
 * REAL and DOUBLE PRECISION variable and bounds in DO loops
 * Integer literals without explicit kind specifiers that are out of range
   for the default kind of INTEGER are assumed to have the least larger kind


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D112350.381675.patch
Type: text/x-patch
Size: 1275 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20211022/8d2d19ae/attachment.bin>


More information about the flang-commits mailing list