Skip to content

Commit

Permalink
Merge remote-tracking branch 'neroburner/simdjson_0.5.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
aras-p committed Oct 3, 2020
2 parents e4a52e6 + 5651246 commit f6f55be
Show file tree
Hide file tree
Showing 3 changed files with 21,091 additions and 10,123 deletions.
14 changes: 8 additions & 6 deletions src/BuildEvents.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ struct BuildEventsParser
return index;
}

bool ParseRoot(simdjson::document::parser::Iterator& it, const std::string& curFileName)
bool ParseRoot(simdjson::dom::parser::Iterator& it, const std::string& curFileName)
{
if (!it.is_object())
return false;
Expand All @@ -226,7 +226,7 @@ struct BuildEventsParser
return ParseTraceEvents(it, curFileName);
}

bool ParseTraceEvents(simdjson::document::parser::Iterator& it, const std::string& curFileName)
bool ParseTraceEvents(simdjson::dom::parser::Iterator& it, const std::string& curFileName)
{
if (!it.is_array())
return false;
Expand Down Expand Up @@ -269,7 +269,7 @@ struct BuildEventsParser
const char* kArgs = "args";
const char* kDetail = "detail";

void ParseEvent(simdjson::document::parser::Iterator& it, const std::string& curFileName, BuildEvents& fileEvents, NameToIndexMap& nameToIndexLocal)
void ParseEvent(simdjson::dom::parser::Iterator& it, const std::string& curFileName, BuildEvents& fileEvents, NameToIndexMap& nameToIndexLocal)
{
if (!it.is_object())
{
Expand Down Expand Up @@ -422,14 +422,16 @@ void DeleteBuildEventsParser(BuildEventsParser* parser)
bool ParseBuildEvents(BuildEventsParser* parser, const std::string& fileName)
{
using namespace simdjson;
auto [doc, error] = document::parse(get_corpus(fileName));
dom::parser p;
dom::element doc;
auto error = p.load(fileName).get(doc);
if (error)
{
printf("%sWARN: JSON parse error %s.%s\n", col::kYellow, error_message(error).c_str(), col::kReset);
printf("%sWARN: JSON parse error %s.%s\n", col::kYellow, error_message(error), col::kReset);
return false;
}

document::parser::Iterator it(doc);
dom::parser::Iterator it(p);
return parser->ParseRoot(it, fileName);
//DebugPrintEvents(outEvents, outNames);
}
Expand Down
Loading

0 comments on commit f6f55be

Please sign in to comment.