"...git@developer.sourcefind.cn:SIYIXNI/vllm.git" did not exist on "4a151dd45308f812d125b6ea239b1730b7f647c4"
Commit 80cf3c98 authored by Jesse Beder's avatar Jesse Beder
Browse files

Fixed minor things that used the old API, compiles/links/runs\!

parent f7b22472
...@@ -16,7 +16,9 @@ namespace YAML ...@@ -16,7 +16,9 @@ namespace YAML
inline bool operator == (const _Null&, const _Null&) { return true; } inline bool operator == (const _Null&, const _Null&) { return true; }
inline bool operator != (const _Null&, const _Null&) { return false; } inline bool operator != (const _Null&, const _Null&) { return false; }
#if YAML_CPP_OLD_API
YAML_CPP_API bool IsNull(const Node& node); YAML_CPP_API bool IsNull(const Node& node);
#endif
extern YAML_CPP_API _Null Null; extern YAML_CPP_API _Null Null;
} }
......
#include "yaml-cpp/null.h" #include "yaml-cpp/null.h"
#if YAML_CPP_OLD_API
#include "yaml-cpp/node.h" #include "yaml-cpp/node.h"
#endif
namespace YAML namespace YAML
{ {
_Null Null; _Null Null;
#if YAML_CPP_OLD_API
bool IsNull(const Node& node) bool IsNull(const Node& node)
{ {
return node.Read(Null); return node.Read(Null);
} }
#endif
} }
...@@ -3,5 +3,6 @@ ...@@ -3,5 +3,6 @@
namespace Test { namespace Test {
bool RunParserTests() bool RunParserTests()
{ {
return true;
} }
} }
...@@ -37,14 +37,17 @@ public: ...@@ -37,14 +37,17 @@ public:
void parse(std::istream& input) void parse(std::istream& input)
{ {
try { try {
#if YAML_CPP_OLD_API
YAML::Parser parser(input); YAML::Parser parser(input);
YAML::Node doc; YAML::Node doc;
NullEventHandler handler;
while(parser.GetNextDocument(doc)) { while(parser.GetNextDocument(doc)) {
YAML::Emitter emitter; YAML::Emitter emitter;
emitter << doc; emitter << doc;
std::cout << emitter.c_str() << "\n"; std::cout << emitter.c_str() << "\n";
} }
#else
// TODO: Parse with new API
#endif
} catch(const YAML::Exception& e) { } catch(const YAML::Exception& e) {
std::cerr << e.what() << "\n"; std::cerr << e.what() << "\n";
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment