[PATCH] D40564: [clangd] Simplify common JSON-parsing patterns in Protocol.

2017-11-29 Thread Sam McCall via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL319309: [clangd] Simplify common JSON-parsing patterns in Protocol. (authored by sammccall). Changed prior to commit: https://reviews.llvm.org/D40564?vs=124585&id=124713#toc Repository: rL LLVM http

[PATCH] D40564: [clangd] Simplify common JSON-parsing patterns in Protocol.

2017-11-29 Thread Eric Liu via Phabricator via cfe-commits
ioeric accepted this revision. ioeric added a comment. This revision is now accepted and ready to land. lgtm Comment at: clangd/Protocol.cpp:56 +assert(*this && "Must check this is an object before calling parse()"); +if (const json::Expr *E = O->get(Prop)) { + ret

[PATCH] D40564: [clangd] Simplify common JSON-parsing patterns in Protocol.

2017-11-28 Thread Sam McCall via Phabricator via cfe-commits
sammccall created this revision. Herald added subscribers: cfe-commits, klimek. This makes the parse() functions about as short as they can be given the current signature, and moves all array-traversal etc code to a central location. We keep the ability to distinguish between optional and require