[clangd] Add parsing and value inspection to JSONExpr.
authorSam McCall <sam.mccall@gmail.com>
Tue, 21 Nov 2017 16:00:53 +0000 (16:00 +0000)
committerSam McCall <sam.mccall@gmail.com>
Tue, 21 Nov 2017 16:00:53 +0000 (16:00 +0000)
commitadbaebc24266179c7edebbdceb28a5ef2cbb3da9
tree2ab60b3641f70321dff91572a759af801c8f850f
parenteb89b1d46f1eaca94f234feca53cf9b0ff2e6480
[clangd] Add parsing and value inspection to JSONExpr.

Summary:
This will replace the places where we're using YAMLParser to parse JSON now:
  - the new marshalling code (T::parse()) should handle fewer cases and require
    fewer explicit casts
  - we'll early-reject invalid JSON that YAMLParser accepts
  - we'll be able to fix protocol-parsing bugs caused by the fact that YAML can
    only parse forward

I plan to do the conversion as soon as this lands, but I don't want it in one
patch as the protocol.cpp changes are conflict-prone.

Reviewers: ioeric

Subscribers: ilya-biryukov, cfe-commits

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

llvm-svn: 318774
clang-tools-extra/clangd/JSONExpr.cpp
clang-tools-extra/clangd/JSONExpr.h
clang-tools-extra/unittests/clangd/JSONExprTests.cpp