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
16
#include <
Ark/Utils/Platform.hpp
>
17
#include <
Ark/Utils/Position.hpp
>
18
19
namespace
Ark
20
{
21
struct
ARK_API
CodeErrorContext
final
22
{
23
const
std::string
filename
;
24
const
internal::FileSpan
at
;
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
ARK_API
#define ARK_API
Definition
Module.hpp:22
Platform.hpp
ArkScript configuration macros.
Position.hpp
Defines position utilities (for text in a file) for the parser, formatter, diagnostics.
Ark
Definition
Builtins.hpp:19
std
STL namespace.
Ark::CodeErrorContext
Definition
CodeErrorContext.hpp:22
Ark::CodeErrorContext::at
const internal::FileSpan at
Definition
CodeErrorContext.hpp:24
Ark::CodeErrorContext::filename
const std::string filename
Definition
CodeErrorContext.hpp:23
Ark::CodeErrorContext::CodeErrorContext
CodeErrorContext(std::string filename_, const internal::FileSpan &pos)
Definition
CodeErrorContext.hpp:27
Ark::CodeErrorContext::CodeErrorContext
CodeErrorContext(std::string filename_, const internal::FileSpan &pos, const bool from_macro_expansion)
Definition
CodeErrorContext.hpp:32
Ark::internal::FileSpan
Describes a span for a node/atom in a file, its start position and end position.
Definition
Position.hpp:35
include
Ark
Error
CodeErrorContext.hpp
Generated on Sun Sep 28 2025 15:55:36 for ArkScript by
1.12.0