beginning of compiler
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <vector>
|
||||
#include <deque>
|
||||
#include <map>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <memory>
|
||||
#include <filesystem>
|
||||
#include <set>
|
||||
|
||||
namespace spider {
|
||||
|
||||
// Absolute Types
|
||||
using u8 = std::uint8_t;
|
||||
using u16 = std::uint16_t;
|
||||
using u32 = std::uint32_t;
|
||||
using u64 = std::uint64_t;
|
||||
|
||||
using i8 = std::int8_t;
|
||||
using i16 = std::int16_t;
|
||||
using i32 = std::int32_t;
|
||||
using i64 = std::int64_t;
|
||||
|
||||
using f32 = float; // TODO: SPIDER_EMULATE_FLOAT will control this
|
||||
using f64 = double;
|
||||
|
||||
// TODO: Check if we're on C++23, there is already stdfloat
|
||||
static_assert(sizeof(f32) == 4, "The f32 type must be exactly 4 bytes.");
|
||||
static_assert(sizeof(f64) == 8, "The f64 type must be exactly 8 bytes.");
|
||||
|
||||
// Utility types
|
||||
using isize = std::size_t;
|
||||
|
||||
// Utility imports
|
||||
using std::vector;
|
||||
using std::deque;
|
||||
using std::map;
|
||||
using std::optional;
|
||||
using std::set;
|
||||
|
||||
template<typename T> using ptr = std::shared_ptr<T>;
|
||||
template<typename T> using uptr = std::unique_ptr<T>;
|
||||
|
||||
namespace fs = std::filesystem;
|
||||
|
||||
struct pos {
|
||||
isize line;
|
||||
isize col;
|
||||
pos(isize line = 1, isize col = 1)
|
||||
: line(line), col(col) {}
|
||||
};
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user