ArkScript
A small, lisp-inspired, functional scripting language
CodeErrorContext.hpp
Go to the documentation of this file.
1/**
2 * @file CodeErrorContext.hpp
3 * @author Lex Plateau (lexplt.dev@gmail.com)
4 * @brief Defines a code error context
5 * @date 2025-08-16
6 *
7 * @copyright Copyright (c) 2025
8 *
9 */
10
11#ifndef ARK_ERROR_CODEERRORCONTEXT_HPP
12#define ARK_ERROR_CODEERRORCONTEXT_HPP
13
14#include <string>
15
18
19namespace Ark
20{
22 {
23 const std::string filename;
25 const bool is_macro_expansion = false;
26
27 CodeErrorContext(std::string filename_, const internal::FileSpan& pos) :
28 filename(std::move(filename_)),
29 at(pos)
30 {}
31
32 CodeErrorContext(std::string filename_, const internal::FileSpan& pos, const bool from_macro_expansion) :
33 filename(std::move(filename_)),
34 at(pos),
35 is_macro_expansion(from_macro_expansion)
36 {}
37 };
38}
39
40#endif // ARK_ERROR_CODEERRORCONTEXT_HPP
#define ARK_API
Definition Module.hpp:22
ArkScript configuration macros.
Defines position utilities (for text in a file) for the parser, formatter, diagnostics.
STL namespace.
const internal::FileSpan at
const std::string filename
CodeErrorContext(std::string filename_, const internal::FileSpan &pos)
CodeErrorContext(std::string filename_, const internal::FileSpan &pos, const bool from_macro_expansion)
Describes a span for a node/atom in a file, its start position and end position.
Definition Position.hpp:35