printing fixes, simple type annotations fix, Function and Array type shortcuts removed, '=' in function definition for block/array removed

This commit is contained in:
ProgramSnail 2024-02-23 16:20:02 +03:00
parent d7f1b6c377
commit d8ef39b2bd
11 changed files with 56 additions and 77 deletions

View file

@ -254,8 +254,15 @@ public:
void append_before(const std::string &name) { value_ = name + "." + value_; }
void append_after(const std::string &name) {
value_ += ".";
value_ += name;
value_ += "." + name;
}
std::pair<Identifier, Identifier> split_first() {
const auto pos = value_.find('.');
if (pos == std::string::npos) {
return {Identifier(*this, type_, ""), *this};
}
return {Identifier(*this, type_, value_.substr(0, pos)), Identifier(*this, type_, value_.substr(pos + 1))}; // '.' is leaved out
}
//