//# This file is a part of toml++ and is subject to the the terms of the MIT license. //# Copyright (c) 2019-2020 Mark Gillard //# See https://github.com/marzer/tomlplusplus/blob/master/LICENSE for the full license text. //#----- //# this file was generated by generate_unicode_functions.py - do not modify it directly // SPDX-License-Identifier: MIT #pragma once #include "toml_preprocessor.h" #if TOML_LANG_UNRELEASED // toml/issues/687 (unicode bare keys) #define TOML_ASSUME_CODEPOINT_BETWEEN(first, last) \ TOML_ASSUME(codepoint >= first); \ TOML_ASSUME(codepoint <= last) namespace toml::impl { //# Returns true if a codepoint belongs to any of these categories: Ll, Lm, Lo, Lt, Lu [[nodiscard]] TOML_GNU_ATTR(const) constexpr bool is_unicode_letter(char32_t codepoint) noexcept { if (codepoint < U'\u00AA' || codepoint > U'\U00031349') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\u00AA', U'\U00031349'); switch ((static_cast(codepoint) - 0xAAu) / 3147u) { case 0: { if (codepoint > U'\u0CF2') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\u00AA', U'\u0CF2'); switch ((static_cast(codepoint) - 0xAAu) / 63u) { case 0: return (1ull << (static_cast(codepoint) - 0xAAull)) & 0x7FFFDFFFFFC10801ull; case 1: return codepoint != U'\u00F7'; case 8: return (1ull << (static_cast(codepoint) - 0x2A2ull)) & 0x4000FFF0FFFFFFFFull; case 9: return (1u << (static_cast(codepoint) - 0x2E1u)) & 0x280Fu; case 10: return false; case 11: return (1ull << (static_cast(codepoint) - 0x370ull)) & 0x3FFFD740BCDFull; case 12: return codepoint != U'\u03A2'; case 13: return codepoint != U'\u03F6'; case 15: return codepoint <= U'\u0481' || codepoint >= U'\u048A'; case 18: return codepoint != U'\u0530'; case 19: return codepoint <= U'\u0559' || codepoint >= U'\u0560'; case 21: return codepoint <= U'\u05EA' || codepoint >= U'\u05EF'; case 23: return codepoint != U'\u0653'; case 25: return (1ull << (static_cast(codepoint) - 0x6D1ull)) & 0x4E0060300017ull; case 26: return (1ull << (static_cast(codepoint) - 0x710ull)) & 0x60000000FFFFFFFDull; case 28: return (1ull << (static_cast(codepoint) - 0x78Eull)) & 0x7000000800FFFFFFull; case 29: return (1ull << (static_cast(codepoint) - 0x7CDull)) & 0x7FF821803FFFFFFFull; case 30: return (1ull << (static_cast(codepoint) - 0x80Cull)) & 0x7FF00000110043FFull; case 31: return codepoint <= U'\u0858' || codepoint >= U'\u0860'; case 32: return codepoint != U'\u088A'; case 34: return codepoint <= U'\u0939' || codepoint >= U'\u093D'; case 35: return (1ull << (static_cast(codepoint) - 0x950ull)) & 0x21FFFE0003FF01ull; case 36: return (1ull << (static_cast(codepoint) - 0x986ull)) & 0x8F17F7FFFFE67Full; case 37: return (1ull << (static_cast(codepoint) - 0x9CEull)) & 0x400C000EC001ull; case 38: return (1ull << (static_cast(codepoint) - 0xA05ull)) & 0x1B6FEFFFFFCC3Full; case 39: return (1u << (static_cast(codepoint) - 0xA59u)) & 0xE00002Fu; case 40: return (1ull << (static_cast(codepoint) - 0xA85ull)) & 0x11F6FEFFFFFDDFFull; case 41: return (1ull << (static_cast(codepoint) - 0xAD0ull)) & 0x20000030001ull; case 42: return (1ull << (static_cast(codepoint) - 0xB05ull)) & 0x11F6FEFFFFFCCFFull; case 43: return (1u << (static_cast(codepoint) - 0xB5Cu)) & 0x20003Bu; case 44: return (1ull << (static_cast(codepoint) - 0xB83ull)) & 0x7FF8E31AC7B8FDull; case 46: return (1ull << (static_cast(codepoint) - 0xC05ull)) & 0x1FFFEFFFFFEEFFull; case 47: return (1ull << (static_cast(codepoint) - 0xC3Dull)) & 0x1838000001ull; case 48: return (1ull << (static_cast(codepoint) - 0xC80ull)) & 0x1EFFDFFFFFDDFE1ull; case 49: return (1ull << (static_cast(codepoint) - 0xCB9ull)) & 0x30001A000000011ull; default: return true; } //# chunk summary: 1922 codepoints from 124 ranges (spanning a search area of 3145) } case 1: { if (codepoint < U'\u0D04' || codepoint > U'\u191E') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\u0D04', U'\u191E'); switch ((static_cast(codepoint) - 0xD04u) / 64u) { case 0: return (1ull << (static_cast(codepoint) - 0xD04ull)) & 0x27FFFFFFFFFDDFFull; case 1: return (1ull << (static_cast(codepoint) - 0xD4Eull)) & 0x3F000000E01C1ull; case 2: return (1ull << (static_cast(codepoint) - 0xD85ull)) & 0x797FDFFFFFE3FFFFull; case 3: return codepoint <= U'\u0DC6' || codepoint >= U'\u0E01'; case 4: return (1ull << (static_cast(codepoint) - 0xE04ull)) & 0xF000DFFFFFFFFFFFull; case 5: return codepoint <= U'\u0E46' || codepoint >= U'\u0E81'; case 6: return (1ull << (static_cast(codepoint) - 0xE84ull)) & 0xF200DFFAFFFFFF7Dull; case 7: return (1ull << (static_cast(codepoint) - 0xEC4ull)) & 0x100000000F000005ull; case 9: return codepoint != U'\u0F48'; case 12: return codepoint <= U'\u102A' || codepoint >= U'\u103F'; case 13: return (1ull << (static_cast(codepoint) - 0x1050ull)) & 0x3FFE1C0623C3Full; case 14: return codepoint <= U'\u108E' || codepoint >= U'\u10A0'; case 15: return (1ull << (static_cast(codepoint) - 0x10C4ull)) & 0xFF7FFFFFFFFFF20Bull; case 21: return (1ull << (static_cast(codepoint) - 0x1244ull)) & 0xFFFFFFFFF3D7F3DFull; case 22: return (1ull << (static_cast(codepoint) - 0x1284ull)) & 0xD7F3DFFFFFFFF3DFull; case 23: return (1ull << (static_cast(codepoint) - 0x12C4ull)) & 0xFFFFFFFFFFF7FFF3ull; case 24: return (1ull << (static_cast(codepoint) - 0x1304ull)) & 0xFFFFFFFFFFF3DFFFull; case 25: return codepoint <= U'\u135A' || codepoint >= U'\u1380'; case 26: return codepoint <= U'\u138F' || codepoint >= U'\u13A0'; case 27: return (1ull << (static_cast(codepoint) - 0x13C4ull)) & 0xE3F3FFFFFFFFFFFFull; case 37: return (1ull << (static_cast(codepoint) - 0x1644ull)) & 0xEFFFF9FFFFFFFFFFull; case 38: return codepoint <= U'\u169A' || codepoint >= U'\u16A0'; case 39: return (1ull << (static_cast(codepoint) - 0x16C4ull)) & 0xF01FE07FFFFFFFFFull; case 40: return (1ull << (static_cast(codepoint) - 0x1704ull)) & 0xF0003FFFF0003DFFull; case 41: return (1ull << (static_cast(codepoint) - 0x1744ull)) & 0xF0001DFFF0003FFFull; case 43: return codepoint <= U'\u17D7' || codepoint >= U'\u17DC'; case 45: return codepoint <= U'\u1878' || codepoint >= U'\u1880'; case 46: return (1ull << (static_cast(codepoint) - 0x1884ull)) & 0xFFFFF05FFFFFFFF9ull; case 47: return codepoint <= U'\u18F5' || codepoint >= U'\u1900'; default: return true; } //# chunk summary: 2239 codepoints from 83 ranges (spanning a search area of 3099) } case 2: { if (codepoint < U'\u1950' || codepoint > U'\u2184') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\u1950', U'\u2184'); switch ((static_cast(codepoint) - 0x1950u) / 64u) { case 0: return (1ull << (static_cast(codepoint) - 0x1950ull)) & 0xFFFF001F3FFFFFFFull; case 1: return codepoint <= U'\u19AB' || codepoint >= U'\u19B0'; case 3: return codepoint <= U'\u1A16' || codepoint >= U'\u1A20'; case 7: return codepoint <= U'\u1B33' || codepoint >= U'\u1B45'; case 9: return (1ull << (static_cast(codepoint) - 0x1B90ull)) & 0xFFFFFC00C001FFFFull; case 10: return codepoint <= U'\u1BE5' || codepoint >= U'\u1C00'; case 11: return codepoint <= U'\u1C23' || codepoint >= U'\u1C4D'; case 12: return codepoint <= U'\u1C7D' || codepoint >= U'\u1C80'; case 13: return codepoint <= U'\u1CBA' || codepoint >= U'\u1CBD'; case 14: return (1ull << (static_cast(codepoint) - 0x1CE9ull)) & 0x7FFF8237EFull; case 23: return (1ull << (static_cast(codepoint) - 0x1F10ull)) & 0x3F3FFFFFFFFF3F3Full; case 24: return (1ull << (static_cast(codepoint) - 0x1F50ull)) & 0xFFFF3FFFFFFFAAFFull; case 25: return (1ull << (static_cast(codepoint) - 0x1F90ull)) & 0x1FDC5FDFFFFFFFFFull; case 26: return (1ull << (static_cast(codepoint) - 0x1FD0ull)) & 0x1FDC1FFF0FCFull; case 27: return false; case 28: return codepoint <= U'\u2071' || codepoint >= U'\u207F'; case 30: return (1u << (static_cast(codepoint) - 0x2102u)) & 0x3F21u; case 31: return (1ull << (static_cast(codepoint) - 0x2110ull)) & 0x43E0F3FFBD503E2Full; default: return true; } //# chunk summary: 1184 codepoints from 59 ranges (spanning a search area of 2101) } case 3: { if (codepoint < U'\u2C00' || codepoint > U'\u31BF') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\u2C00', U'\u31BF'); switch ((static_cast(codepoint) - 0x2C00u) / 64u) { case 0: return codepoint != U'\u2C2F'; case 1: return codepoint != U'\u2C5F'; case 2: return true; case 3: return (1ull << (static_cast(codepoint) - 0x2CC0ull)) & 0xC781FFFFFFFFFull; case 4: return (1ull << (static_cast(codepoint) - 0x2D00ull)) & 0xFFFF20BFFFFFFFFFull; case 5: return codepoint <= U'\u2D67' || codepoint >= U'\u2D6F'; case 6: return (1ull << (static_cast(codepoint) - 0x2D80ull)) & 0x7F7F7F7F007FFFFFull; case 7: return (1u << (static_cast(codepoint) - 0x2DC0u)) & 0x7F7F7F7Fu; case 8: return true; case 16: return (1ull << (static_cast(codepoint) - 0x3005ull)) & 0xC1F00000000003ull; case 17: return true; case 18: return (1ull << (static_cast(codepoint) - 0x3080ull)) & 0xFFFFFFFEE07FFFFFull; case 19: return codepoint != U'\u30FB'; case 20: return codepoint != U'\u3100'; case 21: return true; case 22: return codepoint <= U'\u318E' || codepoint >= U'\u31A0'; default: return false; } //# chunk summary: 771 codepoints from 30 ranges (spanning a search area of 1472) } case 4: return codepoint <= U'\u31FF' || codepoint >= U'\u3400'; case 6: return codepoint <= U'\u4DBE' || codepoint >= U'\u4E00'; case 12: return codepoint <= U'\u9FFB' || codepoint >= U'\uA000'; case 13: { if (codepoint < U'\uA079' || codepoint > U'\uACC3') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\uA079', U'\uACC3'); switch ((static_cast(codepoint) - 0xA079u) / 63u) { case 18: return codepoint <= U'\uA4FD' || codepoint >= U'\uA500'; case 22: return codepoint <= U'\uA60C' || codepoint >= U'\uA610'; case 23: return codepoint <= U'\uA62B' || codepoint >= U'\uA640'; case 24: return codepoint <= U'\uA66E' || codepoint >= U'\uA67F'; case 26: return codepoint <= U'\uA6E5' || codepoint >= U'\uA717'; case 27: return codepoint <= U'\uA71F' || codepoint >= U'\uA722'; case 28: return codepoint <= U'\uA788' || codepoint >= U'\uA78B'; case 29: return codepoint <= U'\uA7BF' || codepoint >= U'\uA7C2'; case 30: return (1ull << (static_cast(codepoint) - 0xA7F5ull)) & 0x1FFFBDDFFFull; case 31: return codepoint <= U'\uA822' || codepoint >= U'\uA840'; case 32: return codepoint <= U'\uA873' || codepoint >= U'\uA882'; case 34: return (1ull << (static_cast(codepoint) - 0xA8F2ull)) & 0xFFF001A3Full; case 35: return codepoint <= U'\uA925' || codepoint >= U'\uA930'; case 36: return codepoint <= U'\uA97C' || codepoint >= U'\uA984'; case 37: return codepoint <= U'\uA9B2' || codepoint >= U'\uA9CF'; case 38: return (1ull << (static_cast(codepoint) - 0xA9E0ull)) & 0x3FFFF7C00FFDFull; case 39: return (1ull << (static_cast(codepoint) - 0xAA12ull)) & 0x3FDC000007FFFFFull; case 40: return (1ull << (static_cast(codepoint) - 0xAA60ull)) & 0xFFFFC47FFFFFull; case 41: return (1ull << (static_cast(codepoint) - 0xAA90ull)) & 0x53E62FFFFFFFFull; case 42: return (1ull << (static_cast(codepoint) - 0xAADBull)) & 0x7CFC00380FFE7ull; case 43: return (1ull << (static_cast(codepoint) - 0xAB0Eull)) & 0x7FFFFFFDFDFC01F9ull; case 44: return (1ull << (static_cast(codepoint) - 0xAB4Dull)) & 0x7FFFFFF81FFFBFFFull; case 46: return codepoint <= U'\uABE2' || codepoint >= U'\uAC00'; default: return true; } //# chunk summary: 2554 codepoints from 52 ranges (spanning a search area of 3147) } case 17: return codepoint <= U'\uD7A2' || (codepoint >= U'\uD7B0' && codepoint <= U'\uD7C6') || codepoint >= U'\uD7CB'; case 18: return false; case 19: return false; case 20: { if (codepoint < U'\uF900' || codepoint > U'\U000102D0') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\uF900', U'\U000102D0'); switch ((static_cast(codepoint) - 0xF900u) / 63u) { case 5: return codepoint <= U'\uFA6D' || codepoint >= U'\uFA70'; case 8: return (1ull << (static_cast(codepoint) - 0xFB00ull)) & 0x7FFDFFA0F8007Full; case 9: return (1ull << (static_cast(codepoint) - 0xFB38ull)) & 0x3FFFFFFFFFFFDB5Full; case 17: return codepoint <= U'\uFD3D' || codepoint >= U'\uFD50'; case 18: return codepoint <= U'\uFD8F' || codepoint >= U'\uFD92'; case 21: return false; case 22: return codepoint != U'\uFE6A'; case 24: return codepoint <= U'\uFEFC' || codepoint >= U'\uFF21'; case 25: return codepoint <= U'\uFF3A' || codepoint >= U'\uFF41'; case 27: return (1ull << (static_cast(codepoint) - 0xFFA5ull)) & 0xE7E7E7E3FFFFFFull; case 28: return codepoint != U'\uFFE4'; case 29: return (1ull << (static_cast(codepoint) - 0x10023ull)) & 0x7FFE7FFF6FFFFEFull; case 33: return false; case 34: return false; case 35: return false; case 36: return false; case 37: return false; case 39: return codepoint <= U'\U0001029C' || codepoint >= U'\U000102A0'; default: return true; } //# chunk summary: 1710 codepoints from 34 ranges (spanning a search area of 2513) } case 21: { if (codepoint < U'\U00010300' || codepoint > U'\U00010F1B') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\U00010300', U'\U00010F1B'); switch ((static_cast(codepoint) - 0x10300u) / 64u) { case 0: return codepoint <= U'\U0001031F' || codepoint >= U'\U0001032D'; case 1: return (1ull << (static_cast(codepoint) - 0x10340ull)) & 0x3FFFFFFFFF03FDull; case 2: return codepoint <= U'\U0001039D' || codepoint >= U'\U000103A0'; case 3: return codepoint <= U'\U000103C3' || codepoint >= U'\U000103C8'; case 6: return codepoint <= U'\U0001049D' || codepoint >= U'\U000104B0'; case 7: return codepoint <= U'\U000104D3' || codepoint >= U'\U000104D8'; case 8: return codepoint <= U'\U00010527' || codepoint >= U'\U00010530'; case 10: return false; case 11: return false; case 17: return codepoint <= U'\U00010755' || codepoint >= U'\U00010760'; case 18: return false; case 19: return false; case 20: return (1ull << (static_cast(codepoint) - 0x10800ull)) & 0x91BFFFFFFFFFFD3Full; case 21: return codepoint <= U'\U00010855' || codepoint >= U'\U00010860'; case 23: return codepoint != U'\U000108C0'; case 24: return codepoint <= U'\U00010915' || codepoint >= U'\U00010920'; case 25: return false; case 26: return codepoint <= U'\U000109B7' || codepoint >= U'\U000109BE'; case 27: return false; case 28: return (1ull << (static_cast(codepoint) - 0x10A00ull)) & 0x3FFFFFFEEF0001ull; case 31: return codepoint != U'\U00010AC8'; case 33: return codepoint <= U'\U00010B55' || codepoint >= U'\U00010B60'; case 35: return false; case 41: return false; case 42: return false; case 43: return false; case 44: return false; case 45: return false; case 46: return codepoint <= U'\U00010EA9' || codepoint >= U'\U00010EB0'; case 47: return false; default: return true; } //# chunk summary: 1620 codepoints from 48 ranges (spanning a search area of 3100) } case 22: { if (codepoint < U'\U00010F1C' || codepoint > U'\U00011AF8') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\U00010F1C', U'\U00011AF8'); switch ((static_cast(codepoint) - 0x10F1Cu) / 64u) { case 0: return (1ull << (static_cast(codepoint) - 0x10F1Cull)) & 0x3FFFFF00801ull; case 1: return false; case 3: return codepoint <= U'\U00010FF6' || codepoint >= U'\U00011003'; case 6: return codepoint <= U'\U000110AF' || codepoint >= U'\U000110D0'; case 7: return codepoint <= U'\U000110E8' || codepoint >= U'\U00011103'; case 8: return (1ull << (static_cast(codepoint) - 0x1111Cull)) & 0xFFF00900000007FFull; case 9: return (1ull << (static_cast(codepoint) - 0x1115Cull)) & 0xFFFFFF80047FFFFFull; case 10: return (1ull << (static_cast(codepoint) - 0x1119Cull)) & 0x400001E0007FFFFFull; case 11: return (1ull << (static_cast(codepoint) - 0x111DCull)) & 0xFFBFFFF000000001ull; case 13: return (1u << (static_cast(codepoint) - 0x11280u)) & 0xFFFBD7Fu; case 14: return (1ull << (static_cast(codepoint) - 0x1129Cull)) & 0xFFFFFFFFFFF01FFBull; case 15: return (1ull << (static_cast(codepoint) - 0x112DCull)) & 0xFF99FE0000000007ull; case 16: return (1ull << (static_cast(codepoint) - 0x1131Cull)) & 0x1000023EDFDFFFull; case 18: return false; case 20: return codepoint <= U'\U00011434' || codepoint >= U'\U00011447'; case 21: return codepoint <= U'\U00011461' || codepoint >= U'\U00011480'; case 22: return (1ull << (static_cast(codepoint) - 0x1149Cull)) & 0xB00000FFFFFull; case 23: return false; case 24: return false; case 26: return codepoint <= U'\U000115AE' || codepoint >= U'\U000115D8'; case 28: return codepoint <= U'\U0001162F' || codepoint >= U'\U00011644'; case 30: return codepoint <= U'\U000116AA' || codepoint >= U'\U000116B8'; case 32: return false; case 33: return false; case 34: return false; case 37: return false; case 39: return (1ull << (static_cast(codepoint) - 0x118DCull)) & 0xF6FF27F80000000Full; case 40: return (1ull << (static_cast(codepoint) - 0x1191Cull)) & 0x28000FFFFFull; case 41: return false; case 42: return codepoint <= U'\U000119A7' || codepoint >= U'\U000119AA'; case 43: return (1ull << (static_cast(codepoint) - 0x119E1ull)) & 0x7FFFC0080000005ull; case 44: return (1ull << (static_cast(codepoint) - 0x11A1Cull)) & 0x100000407FFFFFull; case 46: return codepoint <= U'\U00011A9D' || codepoint >= U'\U00011AC0'; default: return true; } //# chunk summary: 1130 codepoints from 67 ranges (spanning a search area of 3037) } case 23: { if (codepoint < U'\U00011C00' || codepoint > U'\U00012543') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\U00011C00', U'\U00012543'); switch ((static_cast(codepoint) - 0x11C00u) / 63u) { case 0: return codepoint != U'\U00011C09'; case 1: return codepoint <= U'\U00011C40' || codepoint >= U'\U00011C72'; case 3: return false; case 4: return (1ull << (static_cast(codepoint) - 0x11D00ull)) & 0x1FFFFFFFFFB7Full; case 5: return (1ull << (static_cast(codepoint) - 0x11D46ull)) & 0xFFFF6FC000001ull; case 6: return codepoint <= U'\U00011D89' || codepoint >= U'\U00011D98'; case 7: return false; case 8: return false; case 9: return false; case 10: return false; case 12: return false; case 13: return false; case 15: return false; case 31: return false; case 32: return false; case 33: return false; default: return true; } //# chunk summary: 1304 codepoints from 16 ranges (spanning a search area of 2372) } case 27: return false; case 28: return false; case 29: { if (codepoint < U'\U00016800' || codepoint > U'\U00017173') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\U00016800', U'\U00017173'); switch ((static_cast(codepoint) - 0x16800u) / 64u) { case 10: return false; case 13: return (1ull << (static_cast(codepoint) - 0x16B40ull)) & 0xE0FFFFF80000000Full; 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 26: return false; case 27: return false; case 29: return codepoint <= U'\U00016F4A' || codepoint >= U'\U00016F50'; case 31: return codepoint != U'\U00016FC0'; default: return true; } //# chunk summary: 1250 codepoints from 14 ranges (spanning a search area of 2420) } case 31: return codepoint <= U'\U000187F6' || codepoint >= U'\U00018800'; case 32: return codepoint <= U'\U00018CD5' || codepoint >= U'\U00018D00'; case 33: return false; case 34: return false; case 35: return codepoint <= U'\U0001B11E' || (codepoint >= U'\U0001B150' && codepoint <= U'\U0001B152') || (codepoint >= U'\U0001B164' && codepoint <= U'\U0001B167') || codepoint >= U'\U0001B170'; case 36: return codepoint <= U'\U0001BC6A' || (codepoint >= U'\U0001BC70' && codepoint <= U'\U0001BC7C') || (codepoint >= U'\U0001BC80' && codepoint <= U'\U0001BC88') || codepoint >= U'\U0001BC90'; case 37: return false; case 38: { 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 39: { if (codepoint < U'\U0001E100' || codepoint > U'\U0001E94B') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\U0001E100', U'\U0001E94B'); switch ((static_cast(codepoint) - 0x1E100u) / 63u) { 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; case 30: return true; case 31: return true; case 32: return true; case 33: return codepoint <= U'\U0001E943' || codepoint >= U'\U0001E94B'; default: return false; } //# chunk summary: 363 codepoints from 7 ranges (spanning a search area of 2124) } case 40: { if (codepoint < U'\U0001EE00' || codepoint > U'\U0001EEBB') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\U0001EE00', U'\U0001EEBB'); switch ((static_cast(codepoint) - 0x1EE00u) / 63u) { case 0: return (1ull << (static_cast(codepoint) - 0x1EE00ull)) & 0xAF7FE96FFFFFFEFull; case 1: return (1ull << (static_cast(codepoint) - 0x1EE42ull)) & 0x7BDFDE5AAA5BAA1ull; case 2: return (1ull << (static_cast(codepoint) - 0x1EE7Eull)) & 0x3FFFEFB83FFFEFFDull; TOML_NO_DEFAULT_CASE; } //# chunk summary: 141 codepoints from 33 ranges (spanning a search area of 188) } case 55: return codepoint <= U'\U0002A6DC' || codepoint >= U'\U0002A700'; case 56: return codepoint <= U'\U0002B733' || (codepoint >= U'\U0002B740' && codepoint <= U'\U0002B81C') || codepoint >= U'\U0002B820'; case 58: return codepoint <= U'\U0002CEA0' || codepoint >= U'\U0002CEB0'; default: return true; } //# chunk summary: 131178 codepoints from 620 ranges (spanning a search area of 201376) } //# Returns true if a codepoint belongs to any of these categories: Nd, Nl [[nodiscard]] TOML_GNU_ATTR(const) constexpr bool is_unicode_number(char32_t codepoint) noexcept { if (codepoint < U'\u0660' || codepoint > U'\U0001FBF9') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\u0660', U'\U0001FBF9'); switch ((static_cast(codepoint) - 0x660u) / 2007u) { case 0: { if (codepoint > U'\u0DEF') return false; return ((static_cast(codepoint) - 0x660u) / 63u) & 0x55555025ull; //# chunk summary: 130 codepoints from 13 ranges (spanning a search area of 1936) } case 1: { if (codepoint < U'\u0E50' || codepoint > U'\u1099') return false; return ((static_cast(codepoint) - 0xE50u) / 59u) & 0x30Dull; //# chunk summary: 50 codepoints from 5 ranges (spanning a search area of 586) } 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 20: { if (codepoint < U'\uA620' || codepoint > U'\uAA59') return false; return ((static_cast(codepoint) - 0xA620u) / 64u) & 0x1CC09ull; //# chunk summary: 70 codepoints from 7 ranges (spanning a search area of 1082) } case 21: return true; case 31: return true; case 32: { 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 33: return codepoint <= U'\U00010D39' || codepoint >= U'\U00011066'; case 34: { if (codepoint < U'\U000110F0' || codepoint > U'\U00011739') return false; return ((static_cast(codepoint) - 0x110F0u) / 62u) & 0x341610Bull; //# chunk summary: 90 codepoints from 9 ranges (spanning a search area of 1610) } case 35: { if (codepoint < U'\U000118E0' || codepoint > U'\U00011DA9') return false; return ((static_cast(codepoint) - 0x118E0u) / 62u) & 0xC4003ull; //# chunk summary: 50 codepoints from 5 ranges (spanning a search area of 1226) } case 36: return true; case 45: return codepoint <= U'\U00016A69' || codepoint >= U'\U00016B50'; case 59: return true; case 60: return codepoint <= U'\U0001E149' || codepoint >= U'\U0001E2F0'; case 61: return true; case 63: return true; default: return false; } //# chunk summary: 876 codepoints from 72 ranges (spanning a search area of 128410) } //# Returns true if a codepoint belongs to any of these categories: Mn, Mc [[nodiscard]] TOML_GNU_ATTR(const) 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) / 1460u) { case 0: { if (codepoint > U'\u085B') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\u0300', U'\u085B'); switch ((static_cast(codepoint) - 0x300u) / 63u) { case 0: return true; case 1: return true; case 6: return true; case 10: return true; case 11: return (1u << (static_cast(codepoint) - 0x5B5u)) & 0x5B5FFu; case 12: return true; case 13: return codepoint <= U'\u065F' || codepoint >= U'\u0670'; case 15: return (1u << (static_cast(codepoint) - 0x6D6u)) & 0xF67E7Fu; case 16: return true; case 17: return true; case 18: return true; case 19: return codepoint <= U'\u07B0' || codepoint >= U'\u07EB'; case 20: return (1ull << (static_cast(codepoint) - 0x7ECull)) & 0x6EFFBC00000200FFull; case 21: return codepoint <= U'\u082D' || codepoint >= U'\u0859'; default: return false; } //# chunk summary: 293 codepoints from 24 ranges (spanning a search area of 1372) } case 1: { if (codepoint < U'\u08D3' || codepoint > U'\u0E4E') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\u08D3', U'\u0E4E'); switch ((static_cast(codepoint) - 0x8D3u) / 64u) { case 0: return codepoint != U'\u08E2'; case 1: return (1u << (static_cast(codepoint) - 0x93Au)) & 0x1BFFFF7u; case 2: return (1ull << (static_cast(codepoint) - 0x953ull)) & 0x1C0000001801Full; case 3: return (1u << (static_cast(codepoint) - 0x9BCu)) & 0x399FDu; case 4: return (1ull << (static_cast(codepoint) - 0x9D7ull)) & 0x1C8000001801ull; case 5: return (1u << (static_cast(codepoint) - 0xA3Cu)) & 0x23987Du; case 6: return (1u << (static_cast(codepoint) - 0xA70u)) & 0xE0023u; case 7: return (1u << (static_cast(codepoint) - 0xABCu)) & 0x3BBFDu; case 8: return (1ull << (static_cast(codepoint) - 0xAE2ull)) & 0x3BF000003ull; case 9: return (1u << (static_cast(codepoint) - 0xB3Cu)) & 0x399FDu; case 10: return (1ull << (static_cast(codepoint) - 0xB55ull)) & 0x200000006007ull; case 11: return (1u << (static_cast(codepoint) - 0xBBEu)) & 0xF71Fu; case 12: return codepoint <= U'\u0BD7' || codepoint >= U'\u0C00'; case 13: return (1u << (static_cast(codepoint) - 0xC3Eu)) & 0xF77Fu; case 14: return (1ull << (static_cast(codepoint) - 0xC55ull)) & 0x700000006003ull; case 15: return (1u << (static_cast(codepoint) - 0xCBCu)) & 0x3DDFDu; case 16: return (1ull << (static_cast(codepoint) - 0xCD5ull)) & 0x780000006003ull; case 17: return (1u << (static_cast(codepoint) - 0xD3Bu)) & 0x7BBFBu; case 18: return (1ull << (static_cast(codepoint) - 0xD57ull)) & 0x1C0000001801ull; case 19: return codepoint <= U'\u0DCA' || codepoint >= U'\u0DCF'; case 20: return (1ull << (static_cast(codepoint) - 0xDD3ull)) & 0x180001FEBull; case 21: return (1u << (static_cast(codepoint) - 0xE31u)) & 0x3FC003F9u; TOML_NO_DEFAULT_CASE; } //# chunk summary: 282 codepoints from 70 ranges (spanning a search area of 1404) } case 2: { if (codepoint < U'\u0EB1' || codepoint > U'\u135F') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\u0EB1', U'\u135F'); switch ((static_cast(codepoint) - 0xEB1u) / 64u) { case 0: return (1u << (static_cast(codepoint) - 0xEB1u)) & 0x1F800FF9u; case 1: return true; case 2: return (1u << (static_cast(codepoint) - 0xF35u)) & 0x615u; case 3: return (1ull << (static_cast(codepoint) - 0xF71ull)) & 0xFFFFFF7FF06FFFFFull; case 4: return codepoint <= U'\u0FBC' || codepoint >= U'\u0FC6'; case 5: return true; case 6: return (1ull << (static_cast(codepoint) - 0x1031ull)) & 0x1FCEE1E000003FFFull; case 7: return (1ull << (static_cast(codepoint) - 0x1071ull)) & 0x1E005FFE000Full; case 18: return true; default: return false; } //# chunk summary: 154 codepoints from 23 ranges (spanning a search area of 1199) } case 3: { if (codepoint < U'\u1712' || codepoint > U'\u193B') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\u1712', U'\u193B'); switch ((static_cast(codepoint) - 0x1712u) / 62u) { case 0: return codepoint <= U'\u1714' || codepoint >= U'\u1732'; case 1: return codepoint <= U'\u1753' || codepoint >= U'\u1772'; case 3: return codepoint <= U'\u17D3' || codepoint >= U'\u17DD'; case 6: return codepoint <= U'\u1886' || codepoint >= U'\u18A9'; case 7: return false; case 8: return codepoint <= U'\u192B' || codepoint >= U'\u1930'; default: return true; } //# chunk summary: 73 codepoints from 11 ranges (spanning a search area of 554) } case 4: { if (codepoint < U'\u1A17' || codepoint > U'\u1DFF') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\u1A17', U'\u1DFF'); switch ((static_cast(codepoint) - 0x1A17u) / 63u) { case 0: return codepoint <= U'\u1A1B' || codepoint >= U'\u1A55'; case 1: return (1ull << (static_cast(codepoint) - 0x1A56ull)) & 0x27FFFFFFDFFull; case 2: return codepoint != U'\u1A95'; case 5: return codepoint <= U'\u1B73' || codepoint >= U'\u1B80'; case 9: return false; case 10: return false; case 11: return (1ull << (static_cast(codepoint) - 0x1CD0ull)) & 0x39021FFFFF7ull; case 12: return false; case 13: return false; case 15: return codepoint != U'\u1DFA'; default: return true; } //# chunk summary: 234 codepoints from 20 ranges (spanning a search area of 1001) } case 5: return (1ull << (static_cast(codepoint) - 0x20D0ull)) & 0x1FFE21FFFull; case 7: { if (codepoint < U'\u2CEF') return false; return ((static_cast(codepoint) - 0x2CEFu) / 63u) & 0x601Dull; //# chunk summary: 44 codepoints from 5 ranges (spanning a search area of 940) } default: return false; } //# chunk summary: 1106 codepoints from 156 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 7: return codepoint <= U'\uA827' || codepoint >= U'\uA82C'; 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: 137 codepoints from 28 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) / 1008u) { case 0: return codepoint == U'\uFB1E' || (codepoint >= U'\uFE00' && codepoint <= U'\uFE0F') || codepoint >= U'\uFE20'; case 1: return codepoint <= U'\U000101FD' || codepoint >= U'\U000102E0'; case 3: return (1ull << (static_cast(codepoint) - 0x10A01ull)) & 0x4380000000007837ull; case 4: return codepoint <= U'\U00010AE6' || (codepoint >= U'\U00010D24' && codepoint <= U'\U00010D27') || codepoint >= U'\U00010EAB'; case 5: { if (codepoint < U'\U00010F46' || codepoint > U'\U0001123E') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\U00010F46', U'\U0001123E'); switch ((static_cast(codepoint) - 0x10F46u) / 64u) { case 1: return false; case 4: return codepoint <= U'\U00011046' || codepoint >= U'\U0001107F'; case 7: return codepoint <= U'\U00011134' || codepoint >= U'\U00011145'; case 8: return (1ull << (static_cast(codepoint) - 0x11146ull)) & 0x1C00200000000001ull; case 10: return codepoint != U'\U000111C6'; case 11: return codepoint <= U'\U00011237' || codepoint >= U'\U0001123E'; default: return true; } //# chunk summary: 100 codepoints from 15 ranges (spanning a search area of 761) } case 6: { if (codepoint < U'\U000112DF' || codepoint > U'\U000116AD') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\U000112DF', U'\U000116AD'); switch ((static_cast(codepoint) - 0x112DFu) / 61u) { case 0: return codepoint <= U'\U000112EA' || codepoint >= U'\U00011300'; case 1: return (1u << (static_cast(codepoint) - 0x1133Bu)) & 0x100733FBu; case 2: return (1u << (static_cast(codepoint) - 0x11362u)) & 0x7C7F3u; case 3: return false; case 4: return false; case 8: return false; case 9: return false; case 10: return false; case 11: return codepoint <= U'\U000115B5' || codepoint >= U'\U000115B8'; case 12: return codepoint <= U'\U000115C0' || codepoint >= U'\U000115DC'; default: return true; } //# chunk summary: 122 codepoints from 18 ranges (spanning a search area of 975) } case 7: { if (codepoint < U'\U000116AE') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\U000116AE', U'\U00011A99'); switch ((static_cast(codepoint) - 0x116AEu) / 63u) { case 0: return true; case 1: return true; case 6: return true; case 10: return (1u << (static_cast(codepoint) - 0x11930u)) & 0xD79BFu; case 12: return codepoint <= U'\U000119D7' || codepoint >= U'\U000119DA'; case 13: return codepoint <= U'\U000119E4' || codepoint >= U'\U00011A01'; case 14: return (1ull << (static_cast(codepoint) - 0x11A33ull)) & 0x1FFC0100F7Full; case 15: return true; default: return false; } //# chunk summary: 119 codepoints from 17 ranges (spanning a search area of 1004) } default: return true; } //# chunk summary: 402 codepoints from 63 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'\U00016FF1') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\U00016AF0', U'\U00016FF1'); switch ((static_cast(codepoint) - 0x16AF0u) / 62u) { case 0: return true; case 1: return true; case 18: return codepoint != U'\U00016F4C'; case 19: return true; case 20: return codepoint <= U'\U00016FE4' || codepoint >= U'\U00016FF0'; default: return false; } //# chunk summary: 75 codepoints from 7 ranges (spanning a search area of 1282) } 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) / 765u) { case 0: { if (codepoint > U'\U0001D244') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\U0001D165', U'\U0001D244'); switch ((static_cast(codepoint) - 0x1D165u) / 56u) { case 0: return (1ull << (static_cast(codepoint) - 0x1D165ull)) & 0x7F3FC03F1Full; case 2: return false; default: return true; } //# chunk summary: 33 codepoints from 6 ranges (spanning a search area of 224) } case 2: return codepoint <= U'\U0001DA36' || codepoint >= U'\U0001DA3B'; case 3: { if (codepoint < U'\U0001DA5C' || codepoint > U'\U0001DAAF') return false; TOML_ASSUME_CODEPOINT_BETWEEN(U'\U0001DA5C', U'\U0001DAAF'); switch ((static_cast(codepoint) - 0x1DA5Cu) / 42u) { case 0: return (1ull << (static_cast(codepoint) - 0x1DA5Cull)) & 0x1000201FFFFull; case 1: return codepoint != U'\U0001DA86'; TOML_NO_DEFAULT_CASE; } //# chunk summary: 39 codepoints from 5 ranges (spanning a search area of 84) } case 4: return (1ull << (static_cast(codepoint) - 0x1E000ull)) & 0x7DBF9FFFF7Full; case 5: return codepoint <= U'\U0001E136' || codepoint >= U'\U0001E2EC'; case 7: return codepoint <= U'\U0001E8D6' || codepoint >= U'\U0001E944'; 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: 2282 codepoints from 293 ranges (spanning a search area of 917232) } } #undef TOML_ASSUME_CODEPOINT_BETWEEN #endif // TOML_LANG_UNRELEASED