/diags

Open source library with file positions, diagnostic messages and source code hints.

Primary LanguageC++MIT LicenseMIT

diags

Travis (.org) Coveralls github Cpp Standard

Open source library with file positions, diagnostic messages and source code hints.

Example

using namespace diags;

sources host{};
auto text = host.open("README.md");

auto const start = text.position(1, 3);
auto const stop = text.position(1, 8);

auto const message =
	(start - stop)[severity::note]
		<< format("{}:", lng::THIS_IS_THE_NAME);

host.push_back(message);

With support for translations, this could be rendered as:

README.md:1:3: remarque: c'est le nom:
# diags
  ^~~~~

Or possibly as:

README.md(1,3): note: this is the name:
# diags
  ^~~~~