Skip to content

Instantly share code, notes, and snippets.

@comex
Created October 5, 2020 18:48
Show Gist options
  • Save comex/7fbfd6d255d3892d0ac22d70059d9d3e to your computer and use it in GitHub Desktop.
Save comex/7fbfd6d255d3892d0ac22d70059d9d3e to your computer and use it in GitHub Desktop.
// c++ -o dptest depfile_parser.cc util.cc edit_distance.cc metrics.cc dptest.cc -std=c++11
#include <stdio.h>
#include <assert.h>
#include "depfile_parser.h"
int main(int argc, char **argv) {
assert(argc == 2);
string err;
DepfileParser parser;
printf("input: {%s}\n", argv[1]);
string arg(argv[1]);
bool ok = parser.Parse(&arg, &err);
if (!ok) {
printf("err: %s\n", err.c_str());
} else {
for (auto out : parser.outs_) {
printf("out: {%.*s}\n", (int)out.size(), out.str_);
}
for (auto in : parser.ins_) {
printf("in: {%.*s}\n", (int)in.size(), in.str_);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment