mirror of
https://codeberg.org/ProgramSnail/lang.git
synced 2025-12-26 16:58:46 +00:00
printing fixes
This commit is contained in:
parent
0bb72e0b10
commit
469cb3581f
23 changed files with 318 additions and 151 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue