| 36 | |
| 37 | |
| 38 | class MyErrorPrinter : public MultiFileErrorCollector { |
| 39 | public: |
| 40 | MyErrorPrinter() { |
| 41 | } |
| 42 | virtual ~MyErrorPrinter() override { |
| 43 | } |
| 44 | |
| 45 | void AddError(const std::string& file_name, int line, int column, const std::string& message) { |
| 46 | |
| 47 | fprintf(stderr, "%s", file_name.c_str()); |
| 48 | |
| 49 | if (line != -1) |
| 50 | fprintf(stderr, ":%d:%d", line + 1, column + 1); |
| 51 | |
| 52 | fprintf(stderr, ": %s\n", message.c_str()); |
| 53 | } |
| 54 | }; |
| 55 | |
| 56 | int ProtoUtils::Parse(const char *file, SyntaxTree *stree, const vector<string> &include_list) { |
| 57 | return Parse(file, stree, nullptr, include_list); |
nothing calls this directly
no outgoing calls
no test coverage detected