aboutsummaryrefslogtreecommitdiff
path: root/boot/driver.cc
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2026-09-24 00:39:51 +0200
committerEugen Wissner <belka@caraus.de>2026-09-24 00:39:51 +0200
commitf7b035a505e86ad916a43ab1dc1a662a6066b011 (patch)
treea54369ae8ad56352d148c4583ab568f7d4869d30 /boot/driver.cc
parent74e75e41fe12f19e5365a3152ffafa1a29376240 (diff)
downloadelna-f7b035a505e86ad916a43ab1dc1a662a6066b011.tar.gz
Move module heading to the top
Diffstat (limited to 'boot/driver.cc')
-rw-r--r--boot/driver.cc25
1 files changed, 15 insertions, 10 deletions
diff --git a/boot/driver.cc b/boot/driver.cc
index 2bcbcb1..14575f7 100644
--- a/boot/driver.cc
+++ b/boot/driver.cc
@@ -23,9 +23,9 @@ namespace elna::boot
{
source_position make_position(const yy::location& location)
{
- auto start_location = boot::location(static_cast<std::size_t>(location.begin.line),
+ const boot::location start_location = boot::location(static_cast<std::size_t>(location.begin.line),
static_cast<std::size_t>(location.begin.column));
- auto end_location = boot::location(static_cast<std::size_t>(location.end.line),
+ const boot::location end_location = boot::location(static_cast<std::size_t>(location.end.line),
static_cast<std::size_t>(location.end.column));
return source_position(start_location, end_location);
@@ -41,6 +41,11 @@ namespace elna::boot
return message;
}
+ bool driver::has_finished() const
+ {
+ return this->tree != nullptr;
+ }
+
static char unescape_character(char escape)
{
switch (escape)
@@ -79,19 +84,19 @@ namespace elna::boot
constexpr unsigned char utf8_lead_tag_3byte = 0xE0;
constexpr unsigned char utf8_lead_tag_4byte = 0xF0;
- constexpr int utf8_continuation_bits = 6;
- constexpr uint32_t utf8_continuation_mask = 0x3F;
+ constexpr std::uint32_t utf8_continuation_bits = 6;
+ constexpr std::uint32_t utf8_continuation_mask = 0x3F;
constexpr unsigned char utf8_continuation_tag = 0x80;
- constexpr uint32_t utf8_surrogate_range_start = 0xD800;
- constexpr uint32_t utf8_surrogate_range_end = 0xDFFF;
- constexpr uint32_t utf8_max_unicode_codepoint = 0x10FFFF;
+ constexpr std::uint32_t utf8_surrogate_range_start = 0xD800;
+ constexpr std::uint32_t utf8_surrogate_range_end = 0xDFFF;
+ constexpr std::uint32_t utf8_max_unicode_codepoint = 0x10FFFF;
static std::optional<std::string> encode_utf8(uint32_t codepoint)
{
- constexpr uint32_t utf8_1byte_max = 0x80;
- constexpr uint32_t utf8_2byte_max = 0x800;
- constexpr uint32_t utf8_3byte_max = 0x10000;
+ constexpr std::uint32_t utf8_1byte_max = 0x80;
+ constexpr std::uint32_t utf8_2byte_max = 0x800;
+ constexpr std::uint32_t utf8_3byte_max = 0x10000;
std::string result;