From f7b035a505e86ad916a43ab1dc1a662a6066b011 Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Thu, 24 Sep 2026 00:39:51 +0200 Subject: Move module heading to the top --- boot/driver.cc | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'boot/driver.cc') 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(location.begin.line), + const boot::location start_location = boot::location(static_cast(location.begin.line), static_cast(location.begin.column)); - auto end_location = boot::location(static_cast(location.end.line), + const boot::location end_location = boot::location(static_cast(location.end.line), static_cast(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 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; -- cgit v1.2.3