mirror of
https://codeberg.org/ProgramSnail/lang.git
synced 2026-01-25 21:17:11 +00:00
combine functions for statements part done
This commit is contained in:
parent
437c9692ec
commit
263b58a17c
7 changed files with 515 additions and 120 deletions
|
|
@ -17,14 +17,13 @@ inline void print_position(std::ostream &out,
|
|||
}
|
||||
|
||||
inline void
|
||||
handle_internal_error(const std::string &message, const std::string &place,
|
||||
std::optional<nodes::Node> node = std::nullopt) {
|
||||
std::cerr << "\x1b[1;31mInternal Error:\x1b[0m " << message << " at "
|
||||
<< place;
|
||||
handle_internal_error(const std::string &message,
|
||||
std::optional<const nodes::Node *> node = std::nullopt) {
|
||||
std::cerr << "\x1b[1;31mInternal Error:\x1b[0m " << message;
|
||||
if (node.has_value()) {
|
||||
std::cerr << ", at ";
|
||||
print_position(std::cerr, node.value().get_start_position(),
|
||||
node.value().get_end_position());
|
||||
std::cerr << " at ";
|
||||
print_position(std::cerr, node.value()->get_start_position(),
|
||||
node.value()->get_end_position());
|
||||
}
|
||||
std::cerr << ".\n";
|
||||
exit(1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue