ArkScript
A small, lisp-inspired, functional scripting language
Diagnostics.hpp File Reference

Tools to report code errors nicely to the user. More...

#include <string>
#include <optional>
#include <iostream>
#include <Ark/Utils/Platform.hpp>
#include <Ark/Utils/Position.hpp>
#include <Ark/Error/Exceptions.hpp>
Include dependency graph for Diagnostics.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Ark::Diagnostics::ErrorLocation
 

Namespaces

namespace  Ark
 
namespace  Ark::Diagnostics
 

Functions

ARK_API void Ark::Diagnostics::makeContext (const ErrorLocation &loc, std::ostream &os, const std::optional< CodeErrorContext > &maybe_context, bool colorize)
 Helper to create a colorized context to report errors to the user.
 
std::string Ark::Diagnostics::makeContextWithNode (const std::string &message, const internal::Node &node)
 Helper used by the compiler to generate a colorized context from a node.
 
ARK_API void Ark::Diagnostics::generate (const CodeError &e, std::ostream &os=std::cout, bool colorize=true)
 Generate a diagnostic from an error and print it to the standard output.
 

Detailed Description

Tools to report code errors nicely to the user.

Author
Lex Plateau (lexpl.nosp@m.t.de.nosp@m.v@gma.nosp@m.il.c.nosp@m.om)
Date
2025-08-16

Definition in file Diagnostics.hpp.