mirror of
https://codeberg.org/ProgramSnail/lang.git
synced 2025-12-05 22:48:43 +00:00
34 lines
792 B
C++
34 lines
792 B
C++
#include "doc_printers.hpp"
|
|
#include "basic_printers.hpp"
|
|
#include "utils.hpp"
|
|
|
|
namespace printers {
|
|
|
|
// TODO
|
|
|
|
void print_docs(const nodes::SymbolDocs &docs, Printer &printer) {
|
|
auto description = docs.get_description();
|
|
|
|
if (description.has_value()) {
|
|
printer.print(": ");
|
|
for (auto &ch : *description.value()) {
|
|
if (ch == '\n') {
|
|
printer.new_indent_line();
|
|
printer.print(": ");
|
|
} else {
|
|
printer.print(std::string(1, ch));
|
|
}
|
|
}
|
|
printer.new_indent_line();
|
|
}
|
|
|
|
for (size_t i = 0; i < docs.get_annotations_info_size(); ++i) {
|
|
print_annotation(*docs.get_annotation(i), printer);
|
|
printer.space();
|
|
printer.print(*docs.get_annotation_info(i));
|
|
printer.new_indent_line();
|
|
}
|
|
|
|
} // IN PROGRESS
|
|
|
|
} // namespace printers
|