printing fixes

This commit is contained in:
ProgramSnail 2023-07-25 21:33:57 +03:00
parent 0bb72e0b10
commit 469cb3581f
23 changed files with 318 additions and 151 deletions

View file

@ -224,12 +224,14 @@ std::string build_annotation(parser::ParseTree::Node parser_node) {
nodes::Identifier build_operator(parser::ParseTree::Node parser_node) {
std::string identifier = parser_node.get_value();
if (identifier.size() > 0 && identifier.front() != '.') {
// for not point only identifiers
while (identifier.size() > 0 && identifier.back() == '.') {
identifier.pop_back();
}
}
// --- points needed for proper printing
// if (identifier.size() > 0 && identifier.front() != '.') {
// // for not point only identifiers
// while (identifier.size() > 0 && identifier.back() == '.') {
// identifier.pop_back();
// }
// }
// ---
return nodes::Identifier(build_node(parser_node), nodes::Identifier::OPERATOR,
identifier);
@ -240,4 +242,11 @@ nodes::Identifier build_placeholder(parser::ParseTree::Node parser_node) {
nodes::Identifier::PLACEHOLDER, "_");
}
// --- empty lines
nodes::EmptyLines build_empty_lines(parser::ParseTree::Node parser_node) {
return nodes::EmptyLines(build_node(parser_node),
parser_node.get_value_length() - 1);
}
} // namespace builders