mirror of
https://codeberg.org/ProgramSnail/lang_2023.git
synced 2026-01-25 13:07:13 +00:00
print & read builtin functions, fixes. execution of programs partially works
This commit is contained in:
parent
27f643dfbc
commit
2556efcaba
16 changed files with 537 additions and 215 deletions
|
|
@ -34,8 +34,15 @@ inline void HandleGeneralError(const std::string& message) {
|
|||
exit(1);
|
||||
}
|
||||
|
||||
inline void HandleInternalError(const std::string& message, const std::string& place) {
|
||||
std::cerr << "\x1b[1;31mInternal Error:\x1b[0m " << message << " at " << place << ".\n";
|
||||
inline void HandleInternalError(const std::string& message,
|
||||
const std::string& place,
|
||||
std::optional<const interpreter::tokens::BaseNode*> node) {
|
||||
std::cerr << "\x1b[1;31mInternal Error:\x1b[0m " << message << " at " << place;
|
||||
if (node.has_value()) {
|
||||
std::cerr << ", at ";
|
||||
PrintPosition(std::cerr, node.value()->start_position, node.value()->end_position);
|
||||
}
|
||||
std::cerr << ".\n";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue