Browse Source

more serializer fixes

pull/2/head
Jacob Dufault 8 years ago
parent
commit
9b89bfc905
  1. 6
      indexer.h
  2. 2
      serializer.h
  3. 2
      test.cc

6
indexer.h

@ -365,7 +365,7 @@ struct FuncDefDefinitionData {
std::vector<FuncRef> callees;
FuncDefDefinitionData(const std::string& usr) : usr(usr) {
assert(usr.size() > 0);
//assert(usr.size() > 0);
}
bool operator==(const FuncDefDefinitionData<TypeId, FuncId, VarId, FuncRef, Location>& other) const {
@ -409,7 +409,7 @@ struct IndexedFuncDef {
IndexedFuncDef() : def("") {} // For serialization
IndexedFuncDef(FuncId id, const std::string& usr) : id(id), def(usr) {
assert(usr.size() > 0);
//assert(usr.size() > 0);
}
bool operator<(const IndexedFuncDef& other) const {
@ -471,7 +471,7 @@ struct IndexedVarDef {
IndexedVarDef() : def("") {} // For serialization
IndexedVarDef(VarId id, const std::string& usr) : id(id), def(usr) {
assert(usr.size() > 0);
//assert(usr.size() > 0);
}
bool operator<(const IndexedVarDef& other) const {

2
serializer.h

@ -122,7 +122,7 @@ void Reflect(Reader& visitor, std::vector<T>& values) {
}
}
template<typename T>
void Reflect(Reader& visitor, optional<T> value) {
void Reflect(Reader& visitor, optional<T>& value) {
T real_value;
Reflect(visitor, real_value);
value = real_value;

2
test.cc

@ -74,8 +74,6 @@ void DiffDocuments(rapidjson::Document& expected, rapidjson::Document& actual) {
}
void VerifySerializeToFrom(IndexedFile& file) {
return; // TODO
std::string expected = file.ToString();
std::string actual = Deserialize("foo.cc", Serialize(file)).ToString();
if (expected != actual) {

Loading…
Cancel
Save