diff options
Diffstat (limited to 'boot/driver.cc')
| -rw-r--r-- | boot/driver.cc | 25 |
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; |
