Update codegen, make use of source location information

This commit is contained in:
Alexander Bock
2023-03-06 15:50:31 +01:00
parent 9287eb6122
commit 8c7c932c78
4 changed files with 13 additions and 3 deletions

View File

@@ -113,7 +113,11 @@ namespace {
}
json << "],";
json << fmt::format(replStr, "returnType", escapedJson(f.returnType));
json << fmt::format(replStr2, "help", escapedJson(f.helpText));
json << fmt::format(replStr, "help", escapedJson(f.helpText));
json << fmt::format(
"\"sourceLocation\": {{ \"file\": {}, \"line\": {} }}",
escapedJson(f.sourceLocation.file), f.sourceLocation.line
);
json << "}";
if (&f != &library.functions.back() || !library.documentations.empty()) {
json << ",";