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

Create string error context for AST errors. More...

#include <sstream>
#include <string>
#include <Ark/Compiler/AST/Node.hpp>
+ Include dependency graph for makeErrorCtx.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Ark::internal::LineColorContextCounts
 

Namespaces

namespace  Ark
 
namespace  Ark::internal
 

Functions

std::string Ark::internal::makeNodeBasedErrorCtx (const std::string &message, const Node &node)
 Construct an error message based on a given node.
 
std::string Ark::internal::makeTokenBasedErrorCtx (const std::string &match, std::size_t line, std::size_t col, const std::string &code)
 Construct an error message based on a given match in the code.
 
std::string Ark::internal::colorizeLine (const std::string &line, LineColorContextCounts &line_color_context_counts)
 Add colors to highlight matching parentheses/curly braces/square braces on a line.
 
bool Ark::internal::isPairableChar (const char c)
 Check if the character passed in can be paired (parentheses, curly braces, or square braces)
 

Detailed Description

Create string error context for AST errors.

Author
Alexandre Plateau (lexpl.nosp@m.t.de.nosp@m.v@gma.nosp@m.il.c.nosp@m.om)
Version
0.2
Date
2022-02-19

Definition in file makeErrorCtx.hpp.