//# this file was generated by generate_unicode_functions.py #pragma once #include "toml_common.h" #if TOML_LANG_HIGHER_THAN(0, 5, 0) // toml/issues/687 #define TOML_ASSUME_CODEPOINT_BETWEEN(first, last) \ TOML_ASSUME(codepoint >= first); \ TOML_ASSUME(codepoint <= last) TOML_IMPL_START { //# Returns true if a codepoint belongs to any of these categories: Ll, Lm, Lo, Lt, Lu [[nodiscard]] constexpr bool is_unicode_letter(char32_t codepoint) noexcept { if (codepoint < U'\u00AA' || codepoint > U'\U0002FA1D') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\u00AA', U'\U0002FA1D'); switch ((static_cast(codepoint) - 0xAAu) / 3046u) { case 0: { if (codepoint > U'\u0C8F') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\u00AA', U'\u0C8F'); switch ((static_cast(codepoint) - 0xAAu) / 64u) { case 0: return (1ull << (static_cast(codepoint) - 0xAAull)) & 0xFFFFDFFFFFC10801ull; case 1: return codepoint != U'\u00F7'; case 8: return (1ull << (static_cast(codepoint) - 0x2AAull)) & 0x7C000FFF0FFFFFFull; case 9: return codepoint != U'\u02EA'; case 10: return false; case 11: return (1ull << (static_cast(codepoint) - 0x370ull)) & 0x3FBFFFFD740BCDFull; case 13: return codepoint != U'\u03F6'; case 15: return codepoint <= U'\u0481' || codepoint >= U'\u048A'; case 18: return (1ull << (static_cast(codepoint) - 0x52Aull)) & 0xFFC09FFFFFFFFFBFull; case 21: return (1ull << (static_cast(codepoint) - 0x5EAull)) & 0xFFC00000000001E1ull; case 23: return codepoint != U'\u066A'; case 24: return (1ull << (static_cast(codepoint) - 0x6AAull)) & 0x18000BFFFFFFFFFFull; case 25: return (1ull << (static_cast(codepoint) - 0x6EEull)) & 0xFFFFFF400027003ull; case 26: return codepoint <= U'\u072F' || codepoint >= U'\u074D'; case 28: return codepoint <= U'\u07B1' || codepoint >= U'\u07CA'; case 29: return (1ull << (static_cast(codepoint) - 0x7EAull)) & 0x44010FFFFFC10C01ull; case 30: return codepoint <= U'\u0858' || codepoint >= U'\u0860'; case 31: return codepoint <= U'\u086A' || codepoint >= U'\u08A0'; case 32: return codepoint != U'\u08B5'; case 34: return (1ull << (static_cast(codepoint) - 0x92Aull)) & 0xFFC0400008FFFFull; case 35: return (1ull << (static_cast(codepoint) - 0x971ull)) & 0xFFFFFCCFF0FFFFull; case 36: return (1ull << (static_cast(codepoint) - 0x9AAull)) & 0xEC00100008F17Full; case 37: return (1ull << (static_cast(codepoint) - 0x9F0ull)) & 0x1FFFFF987E01003ull; case 38: return (1ull << (static_cast(codepoint) - 0xA2Aull)) & 0x1780000000DB7Full; case 39: return (1ull << (static_cast(codepoint) - 0xA72ull)) & 0x7FFFFEEFF80007ull; case 40: return (1ull << (static_cast(codepoint) - 0xAAAull)) & 0xC000400008FB7Full; case 41: return (1ull << (static_cast(codepoint) - 0xAF9ull)) & 0xFFFFFCCFF001ull; case 42: return (1ull << (static_cast(codepoint) - 0xB2Aull)) & 0xEC00000008FB7Full; case 43: return (1ull << (static_cast(codepoint) - 0xB71ull)) & 0x18C6B1EE3F40001ull; case 44: return (1ull << (static_cast(codepoint) - 0xBAAull)) & 0x400000FFF1ull; case 45: return (1ull << (static_cast(codepoint) - 0xC05ull)) & 0xFFFFFEEFFull; case 46: return (1ull << (static_cast(codepoint) - 0xC2Aull)) & 0xC1C0000008FFFFull; case 47: return (1u << (static_cast(codepoint) - 0xC80u)) & 0xDFE1u; default: return true; } // chunk summary: 1867 codepoints from 117 ranges (spanning a search area of 3046) } case 1: { if (codepoint < U'\u0C90' || codepoint > U'\u1875') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\u0C90', U'\u1875'); switch ((static_cast(codepoint) - 0xC90u) / 64u) { case 0: return (1ull << (static_cast(codepoint) - 0xC90ull)) & 0x23EFFDFFFFFDull; case 1: return (1ull << (static_cast(codepoint) - 0xCDEull)) & 0x37F800018000Dull; case 2: return (1ull << (static_cast(codepoint) - 0xD10ull)) & 0x400027FFFFFFFFFDull; case 3: return (1ull << (static_cast(codepoint) - 0xD54ull)) & 0xFFE0FC000003807ull; case 4: return (1ull << (static_cast(codepoint) - 0xD90ull)) & 0x7F2FFBFFFFFC7Full; case 6: return (1ull << (static_cast(codepoint) - 0xE10ull)) & 0x7F000DFFFFFFFFull; case 7: return (1u << (static_cast(codepoint) - 0xE81u)) & 0x7BEBu; case 8: return (1ull << (static_cast(codepoint) - 0xE90ull)) & 0x5F200DFFAFFFFFull; case 9: return codepoint <= U'\u0EDF' || codepoint >= U'\u0F00'; case 10: return codepoint != U'\u0F10'; case 11: return codepoint <= U'\u0F6C' || codepoint >= U'\u0F88'; case 12: return false; case 14: return codepoint <= U'\u102A' || codepoint >= U'\u103F'; case 15: return (1ull << (static_cast(codepoint) - 0x1050ull)) & 0x4003FFE1C0623C3Full; case 16: return (1ull << (static_cast(codepoint) - 0x10A0ull)) & 0x20BFFFFFFFFFull; case 17: return codepoint != U'\u10FB'; case 22: return codepoint != U'\u1249'; case 23: return (1ull << (static_cast(codepoint) - 0x1250ull)) & 0x3DFFFFFFFFFF3D7Full; case 24: return (1ull << (static_cast(codepoint) - 0x1290ull)) & 0xFF3D7F3DFFFFFFFFull; case 25: return codepoint != U'\u12D7'; case 26: return (1ull << (static_cast(codepoint) - 0x1310ull)) & 0xFFFFFFFFFFFFFF3Dull; case 27: return codepoint <= U'\u135A' || codepoint >= U'\u1380'; case 29: return (1ull << (static_cast(codepoint) - 0x13D0ull)) & 0xFFFE3F3FFFFFFFFFull; case 39: return (1ull << (static_cast(codepoint) - 0x1650ull)) & 0xFFFEFFFF9FFFFFFFull; case 40: return codepoint <= U'\u169A' || codepoint >= U'\u16A0'; case 41: return (1ull << (static_cast(codepoint) - 0x16D0ull)) & 0xDFFF01FE07FFFFFFull; case 42: return (1ull << (static_cast(codepoint) - 0x1710ull)) & 0xFFFF0003FFFF0003ull; case 43: return (1ull << (static_cast(codepoint) - 0x1750ull)) & 0xFFFF0001DFFF0003ull; case 45: return codepoint <= U'\u17D7' || codepoint >= U'\u17DC'; default: return true; } // chunk summary: 2139 codepoints from 86 ranges (spanning a search area of 3046) } case 2: { if (codepoint < U'\u1876' || codepoint > U'\u2184') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\u1876', U'\u2184'); switch ((static_cast(codepoint) - 0x1876u) / 63u) { case 0: return (1ull << (static_cast(codepoint) - 0x1876ull)) & 0x7C17FFFFFFFE7C07ull; case 2: return codepoint <= U'\u18F5' || codepoint >= U'\u1900'; case 3: return codepoint <= U'\u196D' || codepoint >= U'\u1970'; case 4: return (1ull << (static_cast(codepoint) - 0x1972ull)) & 0x43FFFFFFFFFFC007ull; case 6: return codepoint <= U'\u1A16' || codepoint >= U'\u1A20'; case 9: return false; case 11: return codepoint <= U'\u1B33' || codepoint >= U'\u1B45'; case 13: return codepoint <= U'\u1BAF' || codepoint >= U'\u1BBA'; case 15: return codepoint <= U'\u1C4F' || codepoint >= U'\u1C5A'; case 16: return (1ull << (static_cast(codepoint) - 0x1C66ull)) & 0x7FFFFC07FCFFFFFFull; case 17: return codepoint <= U'\u1CBA' || codepoint >= U'\u1CBD'; case 18: return (1ull << (static_cast(codepoint) - 0x1CE9ull)) & 0x3FFFFFFFF8237EFull; case 26: return codepoint <= U'\u1F15' || codepoint >= U'\u1F18'; case 27: return (1ull << (static_cast(codepoint) - 0x1F1Bull)) & 0x5FE7E7FFFFFFFFE7ull; case 28: return (1ull << (static_cast(codepoint) - 0x1F5Bull)) & 0x3FFFFFE7FFFFFFF5ull; case 29: return (1ull << (static_cast(codepoint) - 0x1F99ull)) & 0x678FEE2FEFFFFFFFull; case 30: return (1ull << (static_cast(codepoint) - 0x1FD8ull)) & 0x1FDC1FFF0Full; case 31: return false; case 32: return (1ull << (static_cast(codepoint) - 0x2071ull)) & 0xF80004001ull; case 34: return (1u << (static_cast(codepoint) - 0x2102u)) & 0x1FF21u; case 35: return (1ull << (static_cast(codepoint) - 0x2113ull)) & 0x87C1E7FF7AA07C5ull; default: return true; } // chunk summary: 1328 codepoints from 65 ranges (spanning a search area of 2319) } case 3: { if (codepoint < U'\u2C00' || codepoint > U'\u3041') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\u2C00', U'\u3041'); switch ((static_cast(codepoint) - 0x2C00u) / 61u) { case 0: return codepoint != U'\u2C2F'; case 1: return codepoint != U'\u2C5F'; case 2: return true; case 3: return (1ull << (static_cast(codepoint) - 0x2CB7ull)) & 0x18F03FFFFFFFFFFFull; case 4: return (1ull << (static_cast(codepoint) - 0x2D00ull)) & 0x120BFFFFFFFFFull; case 5: return true; case 6: return (1ull << (static_cast(codepoint) - 0x2D6Full)) & 0xEFE00FFFFFE0001ull; case 7: return (1ull << (static_cast(codepoint) - 0x2DABull)) & 0xFEFEFEFEFEFEFull; case 9: return true; case 16: return true; case 17: return (1u << (static_cast(codepoint) - 0x3031u)) & 0x10C1Fu; default: return false; } // chunk summary: 420 codepoints from 24 ranges (spanning a search area of 1090) } case 4: { if (codepoint < U'\u3042' || codepoint > U'\u3C27') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\u3042', U'\u3C27'); switch ((static_cast(codepoint) - 0x3042u) / 64u) { case 1: return (1ull << (static_cast(codepoint) - 0x3082ull)) & 0xFFFFFFFFB81FFFFFull; case 2: return codepoint != U'\u30FB'; case 3: return codepoint != U'\u3102'; case 5: return codepoint <= U'\u318E' || codepoint >= U'\u31A0'; case 7: return false; case 8: return false; case 9: return false; case 10: return false; case 11: return false; case 12: return false; case 13: return false; default: return true; } // chunk summary: 2450 codepoints from 9 ranges (spanning a search area of 3046) } case 6: return codepoint <= U'\u4DB4' || codepoint >= U'\u4E00'; case 13: { if (codepoint < U'\u9B58' || codepoint > U'\uA73D') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\u9B58', U'\uA73D'); switch ((static_cast(codepoint) - 0x9B58u) / 64u) { case 18: return codepoint <= U'\u9FEE' || codepoint >= U'\uA000'; case 38: return codepoint <= U'\uA4FD' || codepoint >= U'\uA500'; case 42: return codepoint <= U'\uA60C' || codepoint >= U'\uA610'; case 43: return (1ull << (static_cast(codepoint) - 0xA618ull)) & 0xFFFFFF00000C00FFull; case 44: return codepoint <= U'\uA66E' || codepoint >= U'\uA67F'; case 45: return codepoint <= U'\uA69D' || codepoint >= U'\uA6A0'; case 46: return codepoint <= U'\uA6E5' || codepoint >= U'\uA717'; case 47: return codepoint <= U'\uA71F' || codepoint >= U'\uA722'; default: return true; } // chunk summary: 2858 codepoints from 11 ranges (spanning a search area of 3046) } case 14: { if (codepoint < U'\uA73E' || codepoint > U'\uB323') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\uA73E', U'\uB323'); switch ((static_cast(codepoint) - 0xA73Eu) / 64u) { case 1: return codepoint <= U'\uA788' || codepoint >= U'\uA78B'; case 2: return (1ull << (static_cast(codepoint) - 0xA7BEull)) & 0xFE000000000001F3ull; case 3: return (1ull << (static_cast(codepoint) - 0xA7FEull)) & 0x1FFFFFDEEFull; case 6: return (1u << (static_cast(codepoint) - 0xA8F2u)) & 0xA3Fu; case 7: return (1ull << (static_cast(codepoint) - 0xA8FEull)) & 0xFFFC00FFFFFFF001ull; case 8: return codepoint <= U'\uA946' || codepoint >= U'\uA960'; case 10: return (1ull << (static_cast(codepoint) - 0xA9CFull)) & 0x7801FFBE0001ull; case 11: return codepoint != U'\uA9FF'; case 12: return (1ull << (static_cast(codepoint) - 0xAA40ull)) & 0x47FFFFF00000FF7ull; case 13: return (1ull << (static_cast(codepoint) - 0xAA7Eull)) & 0xF98BFFFFFFFFFFFFull; case 14: return (1ull << (static_cast(codepoint) - 0xAAC0ull)) & 0x1C07FF38000005ull; case 15: return (1ull << (static_cast(codepoint) - 0xAB01ull)) & 0x1FFFBFBF803F3F3Full; case 16: return (1ull << (static_cast(codepoint) - 0xAB3Eull)) & 0xFFFC03FFDFFFFFFFull; default: return true; } // chunk summary: 2616 codepoints from 43 ranges (spanning a search area of 3046) } case 18: return codepoint <= U'\uD7A2' || (codepoint >= U'\uD7B0' && codepoint <= U'\uD7C6') || codepoint >= U'\uD7CB'; case 19: return false; case 20: return codepoint <= U'\uFA6D' || codepoint >= U'\uFA70'; case 21: { if (codepoint < U'\uFA88' || codepoint > U'\U0001066D') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\uFA88', U'\U0001066D'); switch ((static_cast(codepoint) - 0xFA88u) / 64u) { case 1: return codepoint <= U'\uFAD9' || codepoint >= U'\uFB00'; case 2: return (1ull << (static_cast(codepoint) - 0xFB13ull)) & 0x1B6BEFFFBFF41Full; case 12: return codepoint <= U'\uFD8F' || codepoint >= U'\uFD92'; case 14: return false; case 15: return codepoint != U'\uFE48'; case 18: return codepoint <= U'\uFF3A' || codepoint >= U'\uFF41'; case 19: return codepoint <= U'\uFF5A' || codepoint >= U'\uFF66'; case 20: return codepoint <= U'\uFFBE' || codepoint >= U'\uFFC2'; case 21: return (1ull << (static_cast(codepoint) - 0xFFCAull)) & 0x3FC0000000073F3Full; case 22: return (1ull << (static_cast(codepoint) - 0x10008ull)) & 0xFFB7FFFF7FFFFFEFull; case 23: return (1ull << (static_cast(codepoint) - 0x10048ull)) & 0xFF000000003FFF3Full; case 26: return false; case 27: return false; case 28: return false; case 29: return false; case 30: return false; case 32: return codepoint <= U'\U0001029C' || codepoint >= U'\U000102A0'; case 33: return codepoint <= U'\U000102D0' || codepoint >= U'\U00010300'; case 34: return (1ull << (static_cast(codepoint) - 0x10308ull)) & 0xFDFFFFE000FFFFFFull; case 35: return (1ull << (static_cast(codepoint) - 0x10348ull)) & 0xFF003FFFFFFFFF03ull; case 36: return codepoint <= U'\U0001039D' || codepoint >= U'\U000103A0'; case 37: return codepoint <= U'\U000103CF' || codepoint >= U'\U00010400'; case 40: return codepoint <= U'\U0001049D' || codepoint >= U'\U000104B0'; case 41: return (1ull << (static_cast(codepoint) - 0x104C8ull)) & 0xFF0FFFFFFFFF0FFFull; case 42: return codepoint <= U'\U00010527' || codepoint >= U'\U00010530'; case 44: return false; default: return true; } // chunk summary: 1924 codepoints from 46 ranges (spanning a search area of 3046) } case 22: { if (codepoint < U'\U0001066E' || codepoint > U'\U0001122B') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\U0001066E', U'\U0001122B'); switch ((static_cast(codepoint) - 0x1066Eu) / 64u) { case 3: return (1ull << (static_cast(codepoint) - 0x1072Eull)) & 0x3FC00FFFFFC01FFull; case 4: return false; case 5: return false; case 6: return (1ull << (static_cast(codepoint) - 0x10800ull)) & 0x3FFFFFFFFD3Full; case 7: return (1ull << (static_cast(codepoint) - 0x1082Eull)) & 0xFFFC00FFFFFE46FFull; case 8: return codepoint <= U'\U00010876' || codepoint >= U'\U00010880'; case 10: return (1ull << (static_cast(codepoint) - 0x108EEull)) & 0xFFFC00FFFFFC00DFull; case 13: return codepoint <= U'\U000109B7' || codepoint >= U'\U000109BE'; case 14: return (1ull << (static_cast(codepoint) - 0x10A00ull)) & 0x3FFFFEEF0001ull; case 15: return codepoint <= U'\U00010A35' || codepoint >= U'\U00010A60'; case 16: return codepoint <= U'\U00010A7C' || codepoint >= U'\U00010A80'; case 17: return codepoint != U'\U00010AAE'; case 19: return (1ull << (static_cast(codepoint) - 0x10B2Eull)) & 0xFFFC00FFFFFC00FFull; case 20: return codepoint <= U'\U00010B72' || codepoint >= U'\U00010B80'; case 21: return false; case 25: return codepoint <= U'\U00010CB2' || codepoint >= U'\U00010CC0'; case 26: return codepoint <= U'\U00010CF2' || codepoint >= U'\U00010D00'; case 27: return false; case 28: return false; case 29: return false; case 30: return false; case 31: return false; case 32: return false; case 33: return false; case 34: return codepoint <= U'\U00010F1C' || codepoint >= U'\U00010F27'; case 36: return false; case 38: return codepoint <= U'\U00010FF6' || codepoint >= U'\U00011003'; case 41: return codepoint <= U'\U000110AF' || codepoint >= U'\U000110D0'; case 43: return codepoint <= U'\U00011144' || codepoint >= U'\U00011150'; case 44: return (1ull << (static_cast(codepoint) - 0x1116Eull)) & 0xFFFFFFFFFFE0011Full; case 45: return (1ull << (static_cast(codepoint) - 0x111AEull)) & 0x50000078001Full; case 46: return codepoint != U'\U000111EE'; default: return true; } // chunk summary: 1312 codepoints from 50 ranges (spanning a search area of 3006) } case 23: { if (codepoint < U'\U00011280' || codepoint > U'\U00011D98') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\U00011280', U'\U00011D98'); switch ((static_cast(codepoint) - 0x11280u) / 64u) { case 0: return (1ull << (static_cast(codepoint) - 0x11280ull)) & 0xFFFF01FFBFFFBD7Full; case 1: return true; case 2: return (1ull << (static_cast(codepoint) - 0x11305ull)) & 0x11F6FEFFFFFCCFFull; case 3: return codepoint <= U'\U00011350' || codepoint >= U'\U0001135D'; case 6: return true; case 7: return codepoint <= U'\U0001144A' || codepoint >= U'\U0001145F'; case 8: return true; case 9: return codepoint != U'\U000114C0'; case 12: return true; case 13: return true; case 14: return true; case 15: return true; case 16: return codepoint <= U'\U000116AA' || codepoint >= U'\U000116B8'; case 18: return true; case 22: return true; case 24: return true; case 25: return codepoint <= U'\U000118DF' || codepoint >= U'\U000118FF'; case 28: return codepoint <= U'\U000119A7' || codepoint >= U'\U000119AA'; case 29: return (1ull << (static_cast(codepoint) - 0x119C0ull)) & 0xA0001FFFFull; case 30: return (1ull << (static_cast(codepoint) - 0x11A00ull)) & 0x407FFFFFFFFF801ull; case 31: return codepoint <= U'\U00011A50' || codepoint >= U'\U00011A5C'; case 32: return codepoint <= U'\U00011A89' || codepoint >= U'\U00011A9D'; case 33: return true; case 38: return codepoint != U'\U00011C09'; case 39: return codepoint <= U'\U00011C40' || codepoint >= U'\U00011C72'; case 40: return true; case 42: return (1ull << (static_cast(codepoint) - 0x11D00ull)) & 0x1FFFFFFFFFB7Full; case 43: return (1ull << (static_cast(codepoint) - 0x11D46ull)) & 0x3FFFFF6FC000001ull; case 44: return codepoint <= U'\U00011D89' || codepoint >= U'\U00011D98'; default: return false; } // chunk summary: 888 codepoints from 54 ranges (spanning a search area of 2841) } case 24: return codepoint <= U'\U00011EF2' || (codepoint >= U'\U00012000' && codepoint <= U'\U00012399') || codepoint >= U'\U00012480'; case 26: return false; case 28: return false; case 29: return false; case 30: { if (codepoint < U'\U00016800' || codepoint > U'\U00017183') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\U00016800', U'\U00017183'); switch ((static_cast(codepoint) - 0x16800u) / 63u) { case 9: return codepoint <= U'\U00016A38' || codepoint >= U'\U00016A40'; case 10: return false; case 13: return codepoint <= U'\U00016B43' || codepoint >= U'\U00016B63'; case 14: return codepoint <= U'\U00016B77' || codepoint >= U'\U00016B7D'; case 15: return false; case 16: return false; case 17: return false; case 18: return false; case 19: return false; case 20: return false; case 21: return false; case 22: return false; case 23: return false; case 24: return false; case 27: return false; case 29: return codepoint <= U'\U00016F4A' || codepoint >= U'\U00016F50'; case 31: return false; case 32: return (1ull << (static_cast(codepoint) - 0x16FE0ull)) & 0x7FFFFFFF0000000Bull; default: return true; } // chunk summary: 1266 codepoints from 14 ranges (spanning a search area of 2436) } case 32: return codepoint <= U'\U000187F6' || codepoint >= U'\U00018800'; case 34: return false; case 35: return false; case 36: return codepoint <= U'\U0001B11E' || (codepoint >= U'\U0001B150' && codepoint <= U'\U0001B152') || (codepoint >= U'\U0001B164' && codepoint <= U'\U0001B167') || codepoint >= U'\U0001B170'; case 37: return codepoint <= U'\U0001BC6A' || (codepoint >= U'\U0001BC70' && codepoint <= U'\U0001BC7C') || (codepoint >= U'\U0001BC80' && codepoint <= U'\U0001BC88') || codepoint >= U'\U0001BC90'; case 38: return false; case 39: { if (codepoint < U'\U0001D400' || codepoint > U'\U0001D7CB') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\U0001D400', U'\U0001D7CB'); switch ((static_cast(codepoint) - 0x1D400u) / 61u) { case 1: return codepoint != U'\U0001D455'; case 2: return (1ull << (static_cast(codepoint) - 0x1D47Aull)) & 0x1FF79937FFFFFFFFull; case 3: return (1ull << (static_cast(codepoint) - 0x1D4B7ull)) & 0x1FFFFFFFFFFFDFD7ull; case 4: return (1ull << (static_cast(codepoint) - 0x1D4F4ull)) & 0x1FFFFDFDFE7BFFFFull; case 5: return (1ull << (static_cast(codepoint) - 0x1D531ull)) & 0x1FFFFFFEFE2FBDFFull; case 11: return (1ull << (static_cast(codepoint) - 0x1D69Full)) & 0xFFFFFFBFFFFFE7Full; case 12: return (1ull << (static_cast(codepoint) - 0x1D6DCull)) & 0x1DFFFFFF7FFFFFFFull; case 13: return (1ull << (static_cast(codepoint) - 0x1D719ull)) & 0x1FBFFFFFEFFFFFFFull; case 14: return (1ull << (static_cast(codepoint) - 0x1D756ull)) & 0x1FF7FFFFFDFFFFFFull; case 15: return (1ull << (static_cast(codepoint) - 0x1D793ull)) & 0x1FEFFFFFFBFFFFFull; default: return true; } // chunk summary: 936 codepoints from 30 ranges (spanning a search area of 972) } case 40: { if (codepoint < U'\U0001E100' || codepoint > U'\U0001E87F') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\U0001E100', U'\U0001E87F'); switch ((static_cast(codepoint) - 0x1E100u) / 64u) { case 0: return codepoint <= U'\U0001E12C' || codepoint >= U'\U0001E137'; case 1: return true; case 7: return true; case 28: return true; case 29: return true; default: return false; } // chunk summary: 225 codepoints from 5 ranges (spanning a search area of 1920) } case 41: { if (codepoint < U'\U0001E880' || codepoint > U'\U0001EEBB') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\U0001E880', U'\U0001EEBB'); switch ((static_cast(codepoint) - 0x1E880u) / 64u) { case 0: return true; case 1: return true; case 2: return true; case 3: return codepoint <= U'\U0001E943' || codepoint >= U'\U0001E94B'; case 22: return (1ull << (static_cast(codepoint) - 0x1EE00ull)) & 0xAF7FE96FFFFFFEFull; case 23: return (1ull << (static_cast(codepoint) - 0x1EE42ull)) & 0x17BDFDE5AAA5BAA1ull; case 24: return (1ull << (static_cast(codepoint) - 0x1EE80ull)) & 0xFFFFBEE0FFFFBFFull; default: return false; } // chunk summary: 279 codepoints from 36 ranges (spanning a search area of 1596) } case 58: return codepoint <= U'\U0002B733' || (codepoint >= U'\U0002B740' && codepoint <= U'\U0002B81C') || codepoint >= U'\U0002B820'; case 60: return codepoint <= U'\U0002CEA0' || codepoint >= U'\U0002CEB0'; default: return true; } // chunk summary: 125582 codepoints from 607 ranges (spanning a search area of 194932) } //# Returns true if a codepoint belongs to any of these categories: Nd, Nl [[nodiscard]] constexpr bool is_unicode_number(char32_t codepoint) noexcept { if (codepoint < U'\u0660' || codepoint > U'\U0001E959') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\u0660', U'\U0001E959'); switch ((static_cast(codepoint) - 0x660u) / 1932u) { case 0: { if (codepoint > U'\u0DEB') return false; return ((static_cast(codepoint) - 0x660u) / 63u) & 0x55555025ull; // chunk summary: 126 codepoints from 13 ranges (spanning a search area of 1932) } case 1: { if (codepoint < U'\u0DEC' || codepoint > U'\u1099') return false; return ((static_cast(codepoint) - 0xDECu) / 63u) & 0x63Bull; // chunk summary: 54 codepoints from 6 ranges (spanning a search area of 686) } case 2: { if (codepoint < U'\u16EE' || codepoint > U'\u1C59') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\u16EE', U'\u1C59'); switch ((static_cast(codepoint) - 0x16EEu) / 64u) { case 0: return true; case 3: return true; case 4: return true; case 9: return true; case 11: return true; case 14: return codepoint <= U'\u1A89' || codepoint >= U'\u1A90'; case 17: return true; case 19: return true; case 21: return codepoint <= U'\u1C49' || codepoint >= U'\u1C50'; default: return false; } // chunk summary: 103 codepoints from 11 ranges (spanning a search area of 1388) } case 3: return codepoint <= U'\u2182' || codepoint >= U'\u2185'; case 5: return (1ull << (static_cast(codepoint) - 0x3007ull)) & 0xE0007FC000001ull; case 21: { if (codepoint < U'\uA620' || codepoint > U'\uABF9') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\uA620', U'\uABF9'); switch ((static_cast(codepoint) - 0xA620u) / 63u) { case 0: return true; case 3: return true; case 10: return true; case 11: return codepoint <= U'\uA8D9' || codepoint >= U'\uA900'; case 14: return true; case 15: return codepoint <= U'\uA9D9' || codepoint >= U'\uA9F0'; case 17: return true; case 23: return true; default: return false; } // chunk summary: 80 codepoints from 8 ranges (spanning a search area of 1498) } case 32: return true; case 33: { if (codepoint < U'\U00010140' || codepoint > U'\U000104A9') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\U00010140', U'\U000104A9'); switch ((static_cast(codepoint) - 0x10140u) / 63u) { case 0: return true; case 8: return codepoint <= U'\U00010341' || codepoint >= U'\U0001034A'; case 10: return true; case 13: return true; default: return false; } // chunk summary: 70 codepoints from 5 ranges (spanning a search area of 874) } case 34: return true; case 35: { if (codepoint < U'\U00011066' || codepoint > U'\U000114D9') return false; return ((static_cast(codepoint) - 0x11066u) / 64u) & 0x2842Dull; // chunk summary: 70 codepoints from 7 ranges (spanning a search area of 1140) } case 36: { if (codepoint < U'\U00011650' || codepoint > U'\U00011D59') return false; return ((static_cast(codepoint) - 0x11650u) / 63u) & 0x1100040Bull; // chunk summary: 60 codepoints from 6 ranges (spanning a search area of 1802) } case 37: return codepoint <= U'\U00011DA9' || codepoint >= U'\U00012400'; case 47: return codepoint <= U'\U00016A69' || codepoint >= U'\U00016B50'; case 61: return true; case 62: return true; case 63: return codepoint <= U'\U0001E2F9' || codepoint >= U'\U0001E950'; default: return false; } // chunk summary: 856 codepoints from 70 ranges (spanning a search area of 123642) } //# Returns true if a codepoint belongs to any of these categories: Mn, Mc [[nodiscard]] constexpr bool is_unicode_combining_mark(char32_t codepoint) noexcept { if (codepoint < U'\u0300' || codepoint > U'\U000E01EF') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\u0300', U'\U000E01EF'); switch ((static_cast(codepoint) - 0x300u) / 14332u) { case 0: { if (codepoint > U'\u309A') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\u0300', U'\u309A'); switch ((static_cast(codepoint) - 0x300u) / 183u) { case 0: return true; case 2: return true; case 3: return (1ull << (static_cast(codepoint) - 0x591ull)) & 0x5B5FFFFFFFFFFFull; case 4: return codepoint <= U'\u061A' || (codepoint >= U'\u064B' && codepoint <= U'\u065F') || codepoint == U'\u0670'; case 5: { if (codepoint < U'\u06D6' || codepoint > U'\u0749') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\u06D6', U'\u0749'); switch ((static_cast(codepoint) - 0x6D6u) / 58u) { case 0: return (1u << (static_cast(codepoint) - 0x6D6u)) & 0xF67E7Fu; case 1: return codepoint <= U'\u0711' || codepoint >= U'\u0730'; TOML_NO_DEFAULT_CASE; } // chunk summary: 46 codepoints from 6 ranges (spanning a search area of 116) } case 6: return codepoint == U'\u074A' || (codepoint >= U'\u07A6' && codepoint <= U'\u07B0') || (codepoint >= U'\u07EB' && codepoint <= U'\u07F3') || codepoint == U'\u07FD'; case 7: { if (codepoint < U'\u0816' || codepoint > U'\u085B') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\u0816', U'\u085B'); switch ((static_cast(codepoint) - 0x816u) / 35u) { case 0: return (1u << (static_cast(codepoint) - 0x816u)) & 0xFBBFEFu; default: return true; } // chunk summary: 24 codepoints from 5 ranges (spanning a search area of 70) } case 8: { if (codepoint < U'\u08D3' || codepoint > U'\u0963') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\u08D3', U'\u0963'); switch ((static_cast(codepoint) - 0x8D3u) / 49u) { case 0: return codepoint != U'\u08E2'; case 2: return (1ull << (static_cast(codepoint) - 0x93Aull)) & 0x3003FBFFFF7ull; default: return false; } // chunk summary: 78 codepoints from 6 ranges (spanning a search area of 145) } case 9: { if (codepoint < U'\u0981' || codepoint > U'\u0A03') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\u0981', U'\u0A03'); switch ((static_cast(codepoint) - 0x981u) / 44u) { case 1: return (1u << (static_cast(codepoint) - 0x9BCu)) & 0x80399FDu; case 2: return (1ull << (static_cast(codepoint) - 0x9E2ull)) & 0x390000003ull; default: return true; } // chunk summary: 23 codepoints from 9 ranges (spanning a search area of 131) } case 10: { if (codepoint < U'\u0A3C' || codepoint > U'\u0ACD') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\u0A3C', U'\u0ACD'); switch ((static_cast(codepoint) - 0xA3Cu) / 49u) { case 0: return (1u << (static_cast(codepoint) - 0xA3Cu)) & 0x23987Du; case 1: return (1u << (static_cast(codepoint) - 0xA70u)) & 0xE0023u; case 2: return (1u << (static_cast(codepoint) - 0xABCu)) & 0x3BBFDu; TOML_NO_DEFAULT_CASE; } // chunk summary: 33 codepoints from 12 ranges (spanning a search area of 146) } case 11: { if (codepoint < U'\u0AE2' || codepoint > U'\u0B82') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\u0AE2', U'\u0B82'); switch ((static_cast(codepoint) - 0xAE2u) / 54u) { case 0: return (1ull << (static_cast(codepoint) - 0xAE2ull)) & 0x3BF000003ull; case 1: return (1u << (static_cast(codepoint) - 0xB3Cu)) & 0x399FDu; case 2: return (1ull << (static_cast(codepoint) - 0xB56ull)) & 0x100000003003ull; TOML_NO_DEFAULT_CASE; } // chunk summary: 29 codepoints from 10 ranges (spanning a search area of 161) } case 12: { if (codepoint < U'\u0BBE' || codepoint > U'\u0C4A') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\u0BBE', U'\u0C4A'); switch ((static_cast(codepoint) - 0xBBEu) / 47u) { case 0: return (1u << (static_cast(codepoint) - 0xBBEu)) & 0x200F71Fu; case 2: return (1u << (static_cast(codepoint) - 0xC3Eu)) & 0x177Fu; default: return true; } // chunk summary: 29 codepoints from 8 ranges (spanning a search area of 141) } case 13: { if (codepoint < U'\u0C4B' || codepoint > U'\u0D01') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\u0C4B', U'\u0D01'); switch ((static_cast(codepoint) - 0xC4Bu) / 61u) { case 0: return (1ull << (static_cast(codepoint) - 0xC4Bull)) & 0x1C0000001800C07ull; case 1: return codepoint != U'\u0C88'; case 2: return (1ull << (static_cast(codepoint) - 0xCC6ull)) & 0xC000000300180F7ull; TOML_NO_DEFAULT_CASE; } // chunk summary: 31 codepoints from 11 ranges (spanning a search area of 183) } case 14: { if (codepoint < U'\u0D02' || codepoint > U'\u0D83') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\u0D02', U'\u0D83'); switch ((static_cast(codepoint) - 0xD02u) / 44u) { case 1: return (1u << (static_cast(codepoint) - 0xD3Bu)) & 0x1007BBFBu; case 2: return codepoint <= U'\u0D63' || codepoint >= U'\u0D82'; default: return true; } // chunk summary: 23 codepoints from 8 ranges (spanning a search area of 130) } case 15: { if (codepoint < U'\u0DCA' || codepoint > U'\u0E4E') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\u0DCA', U'\u0E4E'); switch ((static_cast(codepoint) - 0xDCAu) / 45u) { case 0: return (1ull << (static_cast(codepoint) - 0xDCAull)) & 0x300003FD7E1ull; case 2: return (1u << (static_cast(codepoint) - 0xE31u)) & 0x3FC003F9u; default: return false; } // chunk summary: 34 codepoints from 8 ranges (spanning a search area of 133) } case 16: return codepoint == U'\u0EB1' || (codepoint >= U'\u0EB4' && codepoint <= U'\u0EBC') || (codepoint >= U'\u0EC8' && codepoint <= U'\u0ECD') || codepoint >= U'\u0F18'; case 17: { if (codepoint < U'\u0F35' || codepoint > U'\u0FC6') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\u0F35', U'\u0FC6'); switch ((static_cast(codepoint) - 0xF35u) / 49u) { case 0: return (1u << (static_cast(codepoint) - 0xF35u)) & 0x615u; case 1: return (1ull << (static_cast(codepoint) - 0xF71ull)) & 0x3FF06FFFFFull; case 2: return (1ull << (static_cast(codepoint) - 0xF97ull)) & 0x803FFFFFFFFDull; TOML_NO_DEFAULT_CASE; } // chunk summary: 75 codepoints from 9 ranges (spanning a search area of 146) } case 18: { if (codepoint < U'\u102B' || codepoint > U'\u108F') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\u102B', U'\u108F'); switch ((static_cast(codepoint) - 0x102Bu) / 51u) { case 0: return codepoint <= U'\u103E' || codepoint >= U'\u1056'; case 1: return (1ull << (static_cast(codepoint) - 0x105Eull)) & 0x2FFF00078FE77ull; TOML_NO_DEFAULT_CASE; } // chunk summary: 54 codepoints from 8 ranges (spanning a search area of 101) } case 19: return true; case 22: return true; case 28: { if (codepoint < U'\u1712' || codepoint > U'\u17BA') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\u1712', U'\u17BA'); switch ((static_cast(codepoint) - 0x1712u) / 57u) { case 0: return codepoint <= U'\u1714' || codepoint >= U'\u1732'; case 1: return codepoint <= U'\u1753' || codepoint >= U'\u1772'; default: return true; } // chunk summary: 17 codepoints from 5 ranges (spanning a search area of 169) } case 29: return codepoint <= U'\u17D3' || codepoint == U'\u17DD' || codepoint >= U'\u180B'; case 30: return codepoint <= U'\u1886' || codepoint == U'\u18A9' || codepoint >= U'\u1920'; case 31: return codepoint <= U'\u192B' || codepoint >= U'\u1930'; case 32: return codepoint <= U'\u1A1B' || (codepoint >= U'\u1A55' && codepoint <= U'\u1A5E') || (codepoint >= U'\u1A60' && codepoint <= U'\u1A7C') || codepoint == U'\u1A7F'; case 33: return codepoint <= U'\u1ABD' || (codepoint >= U'\u1B00' && codepoint <= U'\u1B04') || codepoint >= U'\u1B34'; case 34: return codepoint <= U'\u1B73' || (codepoint >= U'\u1B80' && codepoint <= U'\u1B82') || (codepoint >= U'\u1BA1' && codepoint <= U'\u1BAD') || codepoint >= U'\u1BE6'; case 35: return true; case 36: return (1ull << (static_cast(codepoint) - 0x1CD0ull)) & 0x39021FFFFF7ull; case 37: return codepoint != U'\u1D73'; case 41: return (1ull << (static_cast(codepoint) - 0x20D0ull)) & 0x1FFE21FFFull; case 58: return true; case 59: return codepoint <= U'\u2D7F' || codepoint >= U'\u2DE0'; case 60: return true; case 63: return codepoint <= U'\u302F' || codepoint >= U'\u3099'; default: return false; } // chunk summary: 1102 codepoints from 155 ranges (spanning a search area of 11675) } case 2: { if (codepoint < U'\uA66F' || codepoint > U'\uAAEF') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\uA66F', U'\uAAEF'); switch ((static_cast(codepoint) - 0xA66Fu) / 61u) { case 0: return (1ull << (static_cast(codepoint) - 0xA66Full)) & 0x1800000007FE1ull; case 1: return false; case 3: return false; case 4: return false; case 5: return false; case 6: return (1u << (static_cast(codepoint) - 0xA802u)) & 0x211u; case 10: return codepoint <= U'\uA8F1' || codepoint >= U'\uA8FF'; case 11: return codepoint <= U'\uA92D' || codepoint >= U'\uA947'; case 12: return codepoint <= U'\uA953' || codepoint >= U'\uA980'; case 16: return (1ull << (static_cast(codepoint) - 0xAA43ull)) & 0x100000000000601ull; case 17: return (1ull << (static_cast(codepoint) - 0xAA7Cull)) & 0x19D0000000000003ull; case 18: return (1ull << (static_cast(codepoint) - 0xAABEull)) & 0x3E0000000000Bull; default: return true; } // chunk summary: 136 codepoints from 27 ranges (spanning a search area of 1153) } case 3: return codepoint <= U'\uAAF6' || (codepoint >= U'\uABE3' && codepoint <= U'\uABEA') || codepoint >= U'\uABEC'; case 4: { if (codepoint < U'\uFB1E' || codepoint > U'\U00011A99') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\uFB1E', U'\U00011A99'); switch ((static_cast(codepoint) - 0xFB1Eu) / 128u) { case 0: return true; case 5: return true; case 6: return true; case 13: return true; case 15: return true; case 16: return true; case 29: return (1u << (static_cast(codepoint) - 0x10A01u)) & 0x7837u; case 30: return codepoint <= U'\U00010A3A' || codepoint >= U'\U00010A3F'; case 31: return true; case 36: return true; case 40: return true; case 41: return true; case 42: return codepoint <= U'\U00011046' || codepoint >= U'\U0001107F'; case 43: return codepoint <= U'\U000110BA' || codepoint >= U'\U00011100'; case 44: return codepoint <= U'\U00011134' || (codepoint >= U'\U00011145' && codepoint <= U'\U00011146') || codepoint == U'\U00011173' || codepoint >= U'\U00011180'; case 45: return codepoint <= U'\U000111C0' || codepoint >= U'\U000111C9'; case 46: return codepoint <= U'\U00011237' || codepoint >= U'\U0001123E'; case 47: return codepoint <= U'\U000112EA' || codepoint >= U'\U00011300'; case 48: return (1ull << (static_cast(codepoint) - 0x1133Bull)) & 0x3E3F980100733FBull; case 50: return codepoint <= U'\U00011446' || codepoint >= U'\U0001145E'; case 51: return true; case 53: return (1ull << (static_cast(codepoint) - 0x115AFull)) & 0x60000003FE7Full; case 54: return true; case 55: return codepoint <= U'\U000116B7' || codepoint >= U'\U0001171D'; case 56: return true; case 58: return true; case 61: return (1ull << (static_cast(codepoint) - 0x119D1ull)) & 0x3FF00000008FE7Full; case 62: { if (codepoint < U'\U00011A33') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\U00011A33', U'\U00011A99'); switch ((static_cast(codepoint) - 0x11A33u) / 52u) { case 0: return (1ull << (static_cast(codepoint) - 0x11A33ull)) & 0x1FFC0100F7Full; default: return true; } // chunk summary: 39 codepoints from 5 ranges (spanning a search area of 103) } default: return false; } // chunk summary: 383 codepoints from 56 ranges (spanning a search area of 8060) } case 5: { if (codepoint < U'\U00011C2F' || codepoint > U'\U00011EF6') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\U00011C2F', U'\U00011EF6'); switch ((static_cast(codepoint) - 0x11C2Fu) / 60u) { case 0: return codepoint != U'\U00011C37'; case 1: return true; case 2: return codepoint != U'\U00011CA8'; case 4: return (1u << (static_cast(codepoint) - 0x11D31u)) & 0x5FDA3Fu; case 5: return (1u << (static_cast(codepoint) - 0x11D8Au)) & 0x1EDFu; case 6: return true; case 11: return true; default: return false; } // chunk summary: 85 codepoints from 13 ranges (spanning a search area of 712) } case 6: { if (codepoint < U'\U00016AF0' || codepoint > U'\U00016F92') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\U00016AF0', U'\U00016F92'); switch ((static_cast(codepoint) - 0x16AF0u) / 63u) { case 0: return true; case 1: return true; case 17: return codepoint != U'\U00016F1F'; case 18: return codepoint <= U'\U00016F87' || codepoint >= U'\U00016F8F'; default: return false; } // chunk summary: 72 codepoints from 5 ranges (spanning a search area of 1187) } case 7: return true; case 8: { if (codepoint < U'\U0001D165' || codepoint > U'\U0001E94A') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\U0001D165', U'\U0001E94A'); switch ((static_cast(codepoint) - 0x1D165u) / 128u) { case 0: { if (codepoint > U'\U0001D1AD') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\U0001D165', U'\U0001D1AD'); switch ((static_cast(codepoint) - 0x1D165u) / 37u) { case 0: return (1ull << (static_cast(codepoint) - 0x1D165ull)) & 0x1F3FC03F1Full; case 1: return codepoint <= U'\U0001D18B' || codepoint >= U'\U0001D1AA'; TOML_NO_DEFAULT_CASE; } // chunk summary: 30 codepoints from 5 ranges (spanning a search area of 73) } case 1: return true; case 17: return codepoint <= U'\U0001DA36' || codepoint >= U'\U0001DA3B'; case 18: { if (codepoint < U'\U0001DA65' || codepoint > U'\U0001DAAF') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\U0001DA65', U'\U0001DAAF'); switch ((static_cast(codepoint) - 0x1DA65u) / 38u) { case 0: return (1u << (static_cast(codepoint) - 0x1DA65u)) & 0x800100FFu; case 1: return codepoint != U'\U0001DA8B'; TOML_NO_DEFAULT_CASE; } // chunk summary: 30 codepoints from 5 ranges (spanning a search area of 75) } case 29: return (1ull << (static_cast(codepoint) - 0x1E000ull)) & 0x7DBF9FFFF7Full; case 31: return true; case 35: return true; case 46: return true; case 47: return true; default: return false; } // chunk summary: 223 codepoints from 21 ranges (spanning a search area of 6118) } case 63: return true; default: return false; } // chunk summary: 2255 codepoints from 282 ranges (spanning a search area of 917232) } } TOML_IMPL_END #undef TOML_ASSUME_CODEPOINT_BETWEEN #endif // TOML_LANG_HIGHER_THAN(0, 5, 0)