or references, prining improvements, comments now printed, fixes

This commit is contained in:
ProgramSnail 2023-07-31 22:07:32 +03:00
parent 73263193a9
commit 5e70f0015f
19 changed files with 354 additions and 429 deletions

View file

@ -42,6 +42,12 @@ public:
print_spaces(indentation);
}
void to_indentation_level() {
if (indentation_level_ > current_position_) {
print_spaces(indentation_level_ - current_position_);
}
}
void indent() { indentation_level_ += tab_width_; }
void deindent() { indentation_level_ -= tab_width_; }
@ -118,7 +124,8 @@ private:
size_t indentation_level_ = 0;
};
void print_modifier(const nodes::Modifier &modifier, Printer &printer);
void print_modifier(const nodes::Modifier &modifier, Printer &printer,
bool const_is_none = false);
void print_literal(const nodes::Literal &literal, Printer &printer);
@ -126,6 +133,8 @@ void print_identifier(const nodes::Identifier &identifier, Printer &printer);
void print_annotation(const std::string &annotation, Printer &printer);
void print_extra(const nodes::Extra &extra, Printer &printer);
void print_empty_lines(const nodes::EmptyLines &empty_lines, Printer &printer);
} // namespace printers