|
|
@ -51,6 +51,26 @@ using daddr = __uint128;
|
|
|
|
|
|
|
|
|
|
|
|
struct word_base;
|
|
|
|
struct word_base;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
constexpr bool isequal(std::string_view a, std::string_view b)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (a.size() != b.size())
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (unsigned i = 0; i < a.size(); i++) {
|
|
|
|
|
|
|
|
auto ac = a[i];
|
|
|
|
|
|
|
|
if (ac >= 'A' && ac <= 'Z')
|
|
|
|
|
|
|
|
ac += 32;
|
|
|
|
|
|
|
|
auto bc = b[i];
|
|
|
|
|
|
|
|
if (bc >= 'A' && bc <= 'Z')
|
|
|
|
|
|
|
|
bc += 32;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (ac != bc)
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
template<typename T>
|
|
|
|
template<typename T>
|
|
|
|
constexpr std::optional<T> from_chars(std::string_view sv, int base = 10)
|
|
|
|
constexpr std::optional<T> from_chars(std::string_view sv, int base = 10)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -132,7 +152,7 @@ struct word_base : public word_list
|
|
|
|
std::optional<const word_base *> word_list::get(std::string_view sv) const
|
|
|
|
std::optional<const word_base *> word_list::get(std::string_view sv) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
for (auto lt = next; lt; lt = lt->next) {
|
|
|
|
for (auto lt = next; lt; lt = lt->next) {
|
|
|
|
if (sv == lt->name())
|
|
|
|
if (isequal(sv, lt->name()))
|
|
|
|
return lt;
|
|
|
|
return lt;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|