ArkScript
A small, fast, functional and scripting language for video games
Exceptions.hpp File Reference

ArkScript homemade exceptions. More...

#include <string>
#include <vector>
#include <stdexcept>
#include <optional>
#include <ostream>
#include <iostream>
#include <Ark/Compiler/AST/utf8_char.hpp>
#include <Ark/Platform.hpp>
+ Include dependency graph for Exceptions.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Ark::Error
 
class  Ark::TypeError
 A type error triggered when types don't match. More...
 
class  Ark::ZeroDivisionError
 A special zero division error triggered when a number is divided by 0. More...
 
class  Ark::AssertionFailed
 An assertion error, only triggered from ArkScript code through (assert expr error-message) More...
 
struct  Ark::CodeError
 CodeError thrown by the compiler (parser, macro processor, optimizer, and compiler itself) More...
 

Namespaces

namespace  Ark
 
namespace  Ark::internal
 
namespace  Ark::Diagnostics
 

Functions

ARK_API void Ark::Diagnostics::makeContext (std::ostream &os, const std::string &code, std::size_t target_line, std::size_t col_start, std::size_t sym_size)
 Helper to create a colorized context to report errors to the user.
 
ARK_API 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::string code="", std::ostream &os=std::cout)
 Generate a diagnostic from an error and print it to the standard output.
 

Detailed Description

ArkScript homemade exceptions.

Author
Alexandre Plateau (lexpl.nosp@m.t.de.nosp@m.v@gma.nosp@m.il.c.nosp@m.om), Max (madst.nosp@m.k1@p.nosp@m.m.me)
Version
1.2
Date
2020-10-27

Definition in file Exceptions.hpp.