14 #include "llvm/ADT/Hashing.h" 15 #include "llvm/ADT/SmallString.h" 16 #include "llvm/ADT/StringSwitch.h" 17 #include "llvm/Support/ErrorHandling.h" 18 #include "llvm/Support/Format.h" 19 #include "llvm/Support/FormatVariadic.h" 20 #include "llvm/Support/JSON.h" 21 #include "llvm/Support/Path.h" 22 #include "llvm/Support/raw_ostream.h" 30 llvm::StringLiteral prop, T &out,
31 llvm::json::Path path) {
32 const llvm::json::Object *o = params.getAsObject();
36 auto *v = o->get(prop);
37 if (!v || v->getAsNull())
39 return fromJSON(*v, out, path.field(prop));
67 llvm::json::ObjectMapper o(value, path);
68 return o && o.map(
"uri", result.
uri) && o.map(
"kind", result.
kind);
76 return llvm::json::Object{{
"output", value.
output}};
Include the generated interface declarations.
URIForFile uri
The URI of the document to view the output of.
static constexpr const bool value
Represents the parameters used when viewing the output of a PDLL file.
std::string output
The string representation of the output.
Represents the result of viewing the output of a PDLL file.
PDLLViewOutputKind
The type of output to view from PDLL.
llvm::json::Value toJSON(const URIForFile &value)
Add support for JSON serialization.
static bool mapOptOrNull(const llvm::json::Value ¶ms, llvm::StringLiteral prop, T &out, llvm::json::Path path)
PDLLViewOutputKind kind
The kind of output to generate.
bool fromJSON(const llvm::json::Value &value, URIForFile &result, llvm::json::Path path)