Add diagnostic_logger
This commit is contained in:
parent
a0c2eece5b
commit
108fd1b2ee
8 changed files with 165 additions and 15 deletions
18
src/parser.cpp
Normal file
18
src/parser.cpp
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
// Copyright (C) 2017 Jonathan Müller <jonathanmueller.dev@gmail.com>
|
||||
// This file is subject to the license terms in the LICENSE file
|
||||
// found in the top-level directory of this distribution.
|
||||
|
||||
#include <cppast/parser.hpp>
|
||||
|
||||
#include <cstdio>
|
||||
#include <mutex>
|
||||
|
||||
#include <cppast/diagnostic.hpp>
|
||||
|
||||
using namespace cppast;
|
||||
|
||||
bool stderr_diagnostic_logger::do_log(const char* source, const diagnostic& d) const
|
||||
{
|
||||
std::fprintf(stderr, "[%s] %s %s", source, d.location.to_string().c_str(), d.message.c_str());
|
||||
return true;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue