Extended source_location with column and translation unit info

This commit is contained in:
Bartek Kryza
2023-06-12 00:42:37 +02:00
parent 84ec4733cc
commit 43cc5cb49f
7 changed files with 55 additions and 27 deletions

View File

@@ -32,7 +32,9 @@ std::string render_name(std::string name)
void to_json(nlohmann::json &j, const source_location &sl)
{
j = json{{"file", sl.file_relative()}, {"line", sl.line()}};
j = json{{"file", sl.file_relative()},
{"translation_unit", sl.translation_unit()}, {"line", sl.line()},
{"column", sl.column()}};
}
void to_json(nlohmann::json &j, const element &c)