ArkScript
A small, fast, functional and scripting language for video games
Constants.hpp
Go to the documentation of this file.
1/**
2 * @file Constants.hpp
3 * @author Alexandre Plateau ([email protected])
4 * @brief Constants used by ArkScript
5 * @version 0.2
6 * @date 2020-10-27
7 *
8 * @copyright Copyright (c) 2020-2024
9 *
10 */
11
12#ifndef INCLUDE_ARK_CONSTANTS_HPP_IN
13#define INCLUDE_ARK_CONSTANTS_HPP_IN
14
15#include <string_view>
16
17// clang-format off
18constexpr int ARK_VERSION_MAJOR = 4;
19constexpr int ARK_VERSION_MINOR = 0;
20constexpr int ARK_VERSION_PATCH = 0;
21// clang-format on
22constexpr std::string_view ARK_VERSION { "4.0.0" };
23constexpr std::string_view ARK_FULL_VERSION { "4.0.0-2266f3b8" };
24
25#define ARK_COMPILER "AppleClang"
26#define ARK_CACHE_DIRNAME "__arkscript__"
27#define ARK_NO_NAME_FILE "FILE"
28
29#if defined(_WIN32) || defined(_WIN64)
30# define ARK_PLATFORM_NAME "Windows"
31#elif defined(__APPLE__) || defined(__MACH__)
32# define ARK_PLATFORM_NAME "Mac OSX"
33#elif defined(__linux__)
34# define ARK_PLATFORM_NAME "Linux"
35#elif defined(__FreeBSD__)
36# define ARK_PLATFORM_NAME "FreeBSD"
37#elif defined(__unix) || defined(__unix__)
38# define ARK_PLATFORM_NAME "Unix"
39#else
40# define ARK_PLATFORM_NAME "Other"
41#endif
42
43#include <cinttypes>
44#include <cstddef>
45
46namespace Ark
47{
48 // Compiler options
49 constexpr uint16_t FeatureImportSolver = 1 << 0;
50 constexpr uint16_t FeatureMacroProcessor = 1 << 1;
51 constexpr uint16_t FeatureASTOptimizer = 1 << 2;
52 constexpr uint16_t FeatureIROptimizer = 1 << 3;
53
54 constexpr uint16_t FeatureDumpIR = 1 << 14;
55 /// This feature should only be used in tests, to disable diagnostics generation and enable exceptions to be thrown
56 constexpr uint16_t FeatureTestFailOnException = 1 << 15;
57
58 // Default features for the VM x Compiler x Parser
59 constexpr uint16_t DefaultFeatures =
64
65 constexpr std::size_t MaxMacroProcessingDepth = 256; ///< Controls the number of recursive calls to MacroProcessor::processNode
66 constexpr std::size_t MaxMacroUnificationDepth = 256; ///< Controls the number of recursive calls to MacroProcessor::unify
67 constexpr std::size_t VMStackSize = 8192;
68}
69
70#endif
constexpr std::string_view ARK_VERSION
Definition Constants.hpp:22
constexpr int ARK_VERSION_MAJOR
Definition Constants.hpp:18
constexpr int ARK_VERSION_PATCH
Definition Constants.hpp:20
constexpr std::string_view ARK_FULL_VERSION
Definition Constants.hpp:23
constexpr int ARK_VERSION_MINOR
Definition Constants.hpp:19
constexpr uint16_t DefaultFeatures
Definition Constants.hpp:59
constexpr uint16_t FeatureImportSolver
Definition Constants.hpp:49
constexpr std::size_t VMStackSize
Definition Constants.hpp:67
constexpr uint16_t FeatureIROptimizer
Definition Constants.hpp:52
constexpr uint16_t FeatureMacroProcessor
Definition Constants.hpp:50
constexpr std::size_t MaxMacroProcessingDepth
Controls the number of recursive calls to MacroProcessor::processNode.
Definition Constants.hpp:65
constexpr uint16_t FeatureTestFailOnException
This feature should only be used in tests, to disable diagnostics generation and enable exceptions to...
Definition Constants.hpp:56
constexpr std::size_t MaxMacroUnificationDepth
Controls the number of recursive calls to MacroProcessor::unify.
Definition Constants.hpp:66
constexpr uint16_t FeatureASTOptimizer
Definition Constants.hpp:51
constexpr uint16_t FeatureDumpIR
Definition Constants.hpp:54