[PATCH] D40182: [clangd] Add parsing and value inspection to JSONExpr.

Eric Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 20 03:40:15 PST 2017


ioeric added a comment.

Code looks good. Just some nits.



================
Comment at: clangd/JSONExpr.h:62
+// Array and Object also have typed indexing accessors for easy traversal:
+//   if (json::obj* Opts = O.array("options"))
+//     if (Optional<StringRef> Font = Opts->string("font"))
----------------
It's not obvious what `O.array("options")` does. Does it convert `O.at("options")` to an array?


================
Comment at: clangd/JSONExpr.h:78
 public:
-  class Object;
+  enum Kind {
+    Null,
----------------
I wonder if we could merge `Kind` and `ExprType`.


https://reviews.llvm.org/D40182





More information about the cfe-commits mailing list