[PATCH] D80301: [yaml][clang-tidy] Fix multiline YAML serialization

Dmitry Polukhin via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 24 03:12:41 PDT 2020


DmitryPolukhin updated this revision to Diff 272952.
DmitryPolukhin added a comment.

Use double quotation for multiline strings. It solves problems with internal newlines because now they are escaped. Also double quotation solves the problem with leading whitespace after newline. In case of single quotation YAML parsers should remove leading whitespace according to specification. In case of double quotation these leading are internal space and they are preserved. There is no way to instruct YAML parsers to preserve leading whitespaces after newline so double quotation is the only viable option that solves all problems at once.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D80301

Files:
  clang/include/clang/Tooling/ReplacementsYaml.h
  clang/unittests/Tooling/ReplacementsYamlTest.cpp
  llvm/include/llvm/Support/YAMLTraits.h
  llvm/lib/Support/YAMLTraits.cpp
  llvm/unittests/Support/YAMLIOTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80301.272952.patch
Type: text/x-patch
Size: 4742 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200624/01256616/attachment-0001.bin>


More information about the cfe-commits mailing list