[YAML] Plain scalars can not begin with most indicators.
authorHaojian Wu <hokein@google.com>
Mon, 22 Jan 2018 10:20:48 +0000 (10:20 +0000)
committerHaojian Wu <hokein@google.com>
Mon, 22 Jan 2018 10:20:48 +0000 (10:20 +0000)
commit0bbe66e7ac7544812eec34b511fa266d15693a6e
tree8c3d4770e39db71aa7b7da9675637929d29c75ab
parent77a21dbad46d07404f165c5a49c815c3d9b9eedd
[YAML] Plain scalars can not begin with most indicators.

Summary:
Discovered when clangd loads YAML symbols, some symbol documentations
start with indicators (e.g. "-"), but YAML prints them as plain scalars
(no quotes), which make the YAML parser fail to parse.

For these kind of strings, we need quotes.

Reviewers: sammccall

Reviewed By: sammccall

Subscribers: ilya-biryukov, ioeric, llvm-commits, cfe-commits

Differential Revision: https://reviews.llvm.org/D42362

llvm-svn: 323097
llvm/include/llvm/Support/YAMLTraits.h
llvm/unittests/Support/YAMLIOTest.cpp