12#ifndef COMPILER_AST_MAKEERRORCTX_HPP
13#define COMPILER_AST_MAKEERRORCTX_HPP
50 std::string
makeTokenBasedErrorCtx(
const std::string& match, std::size_t line, std::size_t col,
const std::string& code);
69 return c ==
'(' || c ==
')' || c ==
'[' || c ==
']' || c ==
'{' || c ==
'}';
AST node used by the parser, optimizer and compiler.
A node of an Abstract Syntax Tree for ArkScript.
bool isPairableChar(const char c)
Check if the character passed in can be paired (parentheses, curly braces, or square braces)
std::string colorizeLine(const std::string &line, LineColorContextCounts &line_color_context_counts)
Add colors to highlight matching parentheses/curly braces/square braces on a line.
std::string 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 makeNodeBasedErrorCtx(const std::string &message, const Node &node)
Construct an error message based on a given node.