Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/cortex/blob/main/om/uni_rust.om # cortex aien-dev/cortex Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `cortex / om / uni_rust.om` 404 lines ยท 27470 bytes Raw Blame History 1 note om/uni_rust.om - JsonNum module (owner JsonNum). Seeded Omega, OM-2 unit. 2 note Rust std (rustc 1.98.1): str::to_lowercase (full mappings, final-sigma rule, U+0130 -> i + U+0307), 3 note char::is_whitespace / str::trim, lower(hay).contains(lower(needle)), escape table. 4 note API ru_lower: jrs[0 .. jrsl) -> jrl[0 .. jrll); ru_prep: needle jrq[0 .. jrql) -> jrn/jrnl 5 note (uses jrs/jrl as scratch: prepare the needle before filling the haystack); ru_contains 6 note -> bool for haystack jrs/jrsl (lowers it into jrl); ru_trim off n over jrs -> jtro (start), 7 note jtrl (length); ru_isws cp; ru_inr cp w (w 0 cased, 1 case-ignorable, 2 Debug-escaped). 8 note Buffers: jrs uchar `8388608`, jrq uchar `4194304`, jrl uchar `12582912`, jrn uchar `6291456`. 9 note GENERATED TABLES below (jtlr jtkc jtki jtdbg) - do not edit by hand. Generator: 10 note build tests/json/gen/ugen_main.rs with cargo +1.98.1 (rustc 1.98.1 `48a229cea` 2026-09-01), 11 note run it > uni.txt (black-box queries of str::to_lowercase, char::is_whitespace and 12 note for every scalar value), then python3 tests/json/gen/gen_tables.py RYU_TABLE uni.txt. 13 note jtlr = lowercase ranges (start count delta stride; delta signed), jtkc = cased-not-ignorable 14 note intervals, jtki = case-ignorable intervals (as observed through the final-sigma rule), 15 note jtdbg = chars writes as \u{hex} (non-printable or grapheme-extend). 16 text jtlr "65 26 32 1 192 23 32 1 216 7 32 1 256 24 1 2 306 3 1 2 313 8 1 2 330 23 1 2 376 1 -121 1 377 3 1 2 385 1 210 1 386 2 1 2 390 1 206 1 391 1 1 1 393 2 205 1 395 1 1 1 398 1 79 1 399 1 202 1 400 1 203 1 401 1 1 1 403 1 205 1 404 1 207 1 406 1 211 1 407 1 209 1 408 1 1 1 412 1 211 1 413 1 213 1 415 1 214 1 416 3 1 2 422 1 218 1 423 1 1 1 425 1 218 1 428 1 1 1 430 1 218 1 431 1 1 1 433 2 217 1 435 2 1 2 439 1 219 1 440 1 1 1 444 1 1 1 452 1 2 1 453 1 1 1 455 1 2 1 456 1 1 1 458 1 2 1 459 9 1 2 478 9 1 2 497 1 2 1 498 2 1 2 502 1 -97 1 503 1 -56 1 504 20 1 2 544 1 -130 1 546 9 1 2 570 1 10795 1 571 1 1 1 573 1 -163 1 574 1 10792 1 577 1 1 1 579 1 -195 1 580 1 69 1 581 1 71 1 582 5 1 2 880 2 1 2 886 1 1 1 895 1 116 1 902 1 38 1 904 3 37 1 908 1 64 1 910 2 63 1 913 17 32 1 931 9 32 1 975 1 8 1 984 12 1 2 1012 1 -60 1 1015 1 1 1 1017 1 -7 1 1018 1 1 1 1021 3 -130 1 1024 16 80 1 1040 32 32 1 1120 17 1 2 1162 27 1 2 1216 1 15 1 1217 7 1 2 1232 48 1 2 1329 38 48 1 4256 38 7264 1 4295 1 7264 1 4301 1 7264 1 5024 80 38864 1 5104 6 8 1 7305 1 1 1 7312 43 -3008 1 7357 3 -3008 1 7680 75 1 2 7838 1 -7615 1 7840 48 1 2 7944 8 -8 1 7960 6 -8 1 7976 8 -8 1 7992 8 -8 1 8008 6 -8 1 8025 4 -8 2 8040 8 -8 1 8072 8 -8 1 8088 8 -8 1 8104 8 -8 1 8120 2 -8 1 8122 2 -74 1 8124 1 -9 1 8136 4 -86 1 8140 1 -9 1 8152 2 -8 1 8154 2 -100 1 8168 2 -8 1 8170 2 -112 1 8172 1 -7 1 8184 2 -128 1 8186 2 -126 1 8188 1 -9 1 8486 1 -7517 1 8490 1 -8383 1 8491 1 -8262 1 8498 1 28 1 8544 16 16 1 8579 1 1 1 9398 26 26 1 11264 48 48 1 11360 1 1 1 11362 1 -10743 1 11363 1 -3814 1 11364 1 -10727 1 11367 3 1 2 11373 1 -10780 1 11374 1 -10749 1 11375 1 -10783 1 11376 1 -10782 1 11378 1 1 1 11381 1 1 1 11390 2 -10815 1 11392 50 1 2 11499 2 1 2 11506 1 1 1 42560 23 1 2 42624 14 1 2 42786 7 1 2 42802 31 1 2 42873 2 1 2 42877 1 -35332 1 42878 5 1 2 42891 1 1 1 42893 1 -42280 1 42896 2 1 2 42902 10 1 2 42922 1 -42308 1 42923 1 -42319 1 42924 1 -42315 1 42925 1 -42305 1 42926 1 -42308 1 42928 1 -42258 1 42929 1 -42282 1 42930 1 -42261 1 42931 1 928 1 42932 8 1 2 42948 1 -48 1 42949 1 -42307 1 42950 1 -35384 1 42951 2 1 2 42955 1 -42343 1 42956 8 1 2 42972 1 -42561 1 42997 1 1 1 65313 26 32 1 66560 40 40 1 66736 36 40 1 66928 11 39 1 66940 15 39 1 66956 7 39 1 66964 2 39 1 68736 51 64 1 68944 22 32 1 71840 32 32 1 93760 32 32 1 93856 25 27 1 125184 34 34 1" 17 text jtkc "65 90 97 122 170 170 181 181 186 186 192 214 216 246 248 442 444 447 452 659 662 687 880 883 886 887 891 893 895 895 902 902 904 906 908 908 910 929 931 1013 1015 1153 1162 1327 1329 1366 1376 1416 4256 4293 4295 4295 4301 4301 4304 4346 4349 4351 5024 5109 5112 5117 7296 7306 7312 7354 7357 7359 7424 7467 7531 7543 7545 7578 7680 7957 7960 7965 7968 8005 8008 8013 8016 8023 8025 8025 8027 8027 8029 8029 8031 8061 8064 8116 8118 8124 8126 8126 8130 8132 8134 8140 8144 8147 8150 8155 8160 8172 8178 8180 8182 8188 8450 8450 8455 8455 8458 8467 8469 8469 8473 8477 8484 8484 8486 8486 8488 8488 8490 8493 8495 8500 8505 8505 8508 8511 8517 8521 8526 8526 8544 8575 8579 8580 9398 9449 11264 11387 11390 11492 11499 11502 11506 11507 11520 11557 11559 11559 11565 11565 42560 42605 42624 42651 42786 42863 42865 42887 42891 42894 42896 42972 42997 42998 43002 43002 43824 43866 43872 43880 43888 43967 64256 64262 64275 64279 65313 65338 65345 65370 66560 66639 66736 66771 66776 66811 66928 66938 66940 66954 66956 66962 66964 66965 66967 66977 66979 66993 66995 67001 67003 67004 68736 68786 68800 68850 68944 68965 68976 68997 71840 71903 93760 93823 93856 93880 93883 93907 119808 119892 119894 119964 119966 119967 119970 119970 119973 119974 119977 119980 119982 119993 119995 119995 119997 120003 120005 120069 120071 120074 120077 120084 120086 120092 120094 120121 120123 120126 120128 120132 120134 120134 120138 120144 120146 120485 120488 120512 120514 120538 120540 120570 120572 120596 120598 120628 120630 120654 120656 120686 120688 120712 120714 120744 120746 120770 120772 120779 122624 122633 122635 122654 122661 122666 125184 125251 127280 127305 127312 127337 127344 127369" 18 text jtki "39 39 46 46 58 58 94 94 96 96 168 168 173 173 175 175 180 180 183 184 688 879 884 885 890 890 900 901 903 903 1155 1161 1369 1369 1375 1375 1425 1469 1471 1471 1473 1474 1476 1477 1479 1479 1524 1524 1536 1541 1552 1562 1564 1564 1600 1600 1611 1631 1648 1648 1750 1757 1759 1768 1770 1773 1807 1807 1809 1809 1840 1866 1958 1968 2027 2037 2042 2042 2045 2045 2070 2093 2137 2139 2184 2184 2192 2193 2199 2207 2249 2306 2362 2362 2364 2364 2369 2376 2381 2381 2385 2391 2402 2403 2417 2417 2433 2433 2492 2492 2497 2500 2509 2509 2530 2531 2558 2558 2561 2562 2620 2620 2625 2626 2631 2632 2635 2637 2641 2641 2672 2673 2677 2677 2689 2690 2748 2748 2753 2757 2759 2760 2765 2765 2786 2787 2810 2815 2817 2817 2876 2876 2879 2879 2881 2884 2893 2893 2901 2902 2914 2915 2946 2946 3008 3008 3021 3021 3072 3072 3076 3076 3132 3132 3134 3136 3142 3144 3146 3149 3157 3158 3170 3171 3201 3201 3260 3260 3263 3263 3270 3270 3276 3277 3298 3299 3328 3329 3387 3388 3393 3396 3405 3405 3426 3427 3457 3457 3530 3530 3538 3540 3542 3542 3633 3633 3636 3642 3654 3662 3761 3761 3764 3772 3782 3782 3784 3790 3864 3865 3893 3893 3895 3895 3897 3897 3953 3966 3968 3972 3974 3975 3981 3991 3993 4028 4038 4038 4141 4144 4146 4151 4153 4154 4157 4158 4184 4185 4190 4192 4209 4212 4226 4226 4229 4230 4237 4237 4253 4253 4348 4348 4957 4959 5906 5908 5938 5939 5970 5971 6002 6003 6068 6069 6071 6077 6086 6086 6089 6099 6103 6103 6109 6109 6155 6159 6211 6211 6277 6278 6313 6313 6432 6434 6439 6440 6450 6450 6457 6459 6679 6680 6683 6683 6742 6742 6744 6750 6752 6752 6754 6754 6757 6764 6771 6780 6783 6783 6823 6823 6832 6877 6880 6891 6912 6915 6964 6964 6966 6970 6972 6972 6978 6978 7019 7027 7040 7041 7074 7077 7080 7081 7083 7085 7142 7142 7144 7145 7149 7149 7151 7153 7212 7219 7222 7223 7288 7293 7376 7378 7380 7392 7394 7400 7405 7405 7412 7412 7416 7417 7468 7530 7544 7544 7579 7679 8125 8125 8127 8129 8141 8143 8157 8159 8173 8175 8189 8190 8203 8207 8216 8217 8228 8228 8231 8231 8234 8238 8288 8292 8294 8303 8305 8305 8319 8319 8336 8348 8400 8432 11388 11389 11503 11505 11631 11631 11647 11647 11744 11775 11823 11823 12293 12293 12330 12333 12337 12341 12347 12347 12441 12446 12540 12542 40981 40981 42232 42237 42508 42508 42607 42610 42612 42621 42623 42623 42652 42655 42736 42737 42752 42785 42864 42864 42888 42890 42993 42996 43000 43001 43010 43010 43014 43014 43019 43019 43045 43046 43052 43052 43204 43205 43232 43249 43263 43263 43302 43309 43335 43345 43392 43394 43443 43443 43446 43449 43452 43453 43471 43471 43493 43494 43561 43566 43569 43570 43573 43574 43587 43587 43596 43596 43632 43632 43644 43644 43696 43696 43698 43700 43703 43704 43710 43711 43713 43713 43741 43741 43756 43757 43763 43764 43766 43766 43867 43871 43881 43883 44005 44005 44008 44008 44013 44013 64286 64286 64434 64450 65024 65039 65043 65043 65056 65071 65106 65106 65109 65109 65279 65279 65287 65287 65294 65294 65306 65306 65342 65342 65344 65344 65392 65392 65438 65439 65507 65507 65529 65531 66045 66045 66272 66272 66422 66426 67456 67461 67463 67504 67506 67514 68097 68099 68101 68102 68108 68111 68152 68154 68159 68159 68325 68326 68900 68903 68942 68942 68969 68973 68975 68975 69291 69292 69317 69317 69370 69375 69446 69456 69506 69509 69633 69633 69688 69702 69744 69744 69747 69748 69759 69761 69811 69814 69817 69818 69821 69821 69826 69826 69837 69837 69888 69890 69927 69931 69933 69940 70003 70003 70016 70017 70070 70078 70089 70092 70095 70095 70191 70193 70196 70196 70198 70199 70206 70206 70209 70209 70367 70367 70371 70378 70400 70401 70459 70460 70464 70464 70502 70508 70512 70516 70587 70592 70606 70606 70608 70608 70610 70610 70625 70626 70712 70719 70722 70724 70726 70726 70750 70750 70835 70840 70842 70842 70847 70848 70850 70851 71090 71093 71100 71101 71103 71104 71132 71133 71219 71226 71229 71229 71231 71232 71339 71339 71341 71341 71344 71349 71351 71351 71453 71453 71455 71455 71458 71461 71463 71467 71727 71735 71737 71738 71995 71996 71998 71998 72003 72003 72148 72151 72154 72155 72160 72160 72193 72202 72243 72248 72251 72254 72263 72263 72273 72278 72281 72283 72330 72342 72344 72345 72544 72544 72546 72548 72550 72550 72752 72758 72760 72765 72767 72767 72850 72871 72874 72880 72882 72883 72885 72886 73009 73014 73018 73018 73020 73021 73023 73029 73031 73031 73104 73105 73109 73109 73111 73111 73177 73177 73459 73460 73472 73473 73526 73530 73536 73536 73538 73538 73562 73562 78896 78912 78919 78933 90398 90409 90413 90415 92912 92916 92976 92982 92992 92995 93504 93506 93547 93548 94031 94031 94095 94111 94176 94177 94179 94180 94194 94195 110576 110579 110581 110587 110589 110590 113821 113822 113824 113827 118528 118573 118576 118598 119143 119145 119155 119170 119173 119179 119210 119213 119362 119364 121344 121398 121403 121452 121461 121461 121476 121476 121499 121503 121505 121519 122880 122886 122888 122904 122907 122913 122915 122916 122918 122922 122928 122989 123023 123023 123184 123197 123566 123566 123628 123631 124139 124143 124398 124399 124643 124643 124646 124646 124654 124655 124661 124661 124671 124671 125136 125142 125252 125259 127995 127999 917505 917505 917536 917631 917760 917999" 19 text jtdbg "1 8 11 12 14 31 127 160 173 173 768 879 888 889 896 899 907 907 909 909 930 930 1155 1161 1328 1328 1367 1368 1419 1420 1424 1469 1471 1471 1473 1474 1476 1477 1479 1487 1515 1518 1525 1541 1552 1562 1564 1564 1611 1631 1648 1648 1750 1757 1759 1764 1767 1768 1770 1773 1806 1807 1809 1809 1840 1868 1958 1968 1970 1983 2027 2035 2043 2045 2070 2073 2075 2083 2085 2087 2089 2095 2111 2111 2137 2141 2143 2143 2155 2159 2192 2207 2250 2306 2362 2362 2364 2364 2369 2376 2381 2381 2385 2391 2402 2403 2433 2433 2436 2436 2445 2446 2449 2450 2473 2473 2481 2481 2483 2485 2490 2492 2494 2494 2497 2502 2505 2506 2509 2509 2511 2523 2526 2526 2530 2533 2558 2562 2564 2564 2571 2574 2577 2578 2601 2601 2609 2609 2612 2612 2615 2615 2618 2621 2625 2648 2653 2653 2655 2661 2672 2673 2677 2677 2679 2690 2692 2692 2702 2702 2706 2706 2729 2729 2737 2737 2740 2740 2746 2748 2753 2760 2762 2762 2765 2767 2769 2783 2786 2789 2802 2808 2810 2817 2820 2820 2829 2830 2833 2834 2857 2857 2865 2865 2868 2868 2874 2876 2878 2879 2881 2886 2889 2890 2893 2907 2910 2910 2914 2917 2936 2946 2948 2948 2955 2957 2961 2961 2966 2968 2971 2971 2973 2973 2976 2978 2981 2983 2987 2989 3002 3006 3008 3008 3011 3013 3017 3017 3021 3023 3025 3045 3067 3072 3076 3076 3085 3085 3089 3089 3113 3113 3130 3132 3134 3136 3141 3159 3163 3163 3166 3167 3170 3173 3184 3190 3201 3201 3213 3213 3217 3217 3241 3241 3252 3252 3258 3260 3263 3264 3266 3266 3269 3291 3295 3295 3298 3301 3312 3312 3316 3329 3341 3341 3345 3345 3387 3388 3390 3390 3393 3397 3401 3401 3405 3405 3408 3411 3415 3415 3426 3429 3456 3457 3460 3460 3479 3481 3506 3506 3516 3516 3518 3519 3527 3535 3538 3543 3551 3557 3568 3569 3573 3584 3633 3633 3636 3646 3655 3662 3676 3712 3715 3715 3717 3717 3723 3723 3748 3748 3750 3750 3761 3761 3764 3772 3774 3775 3781 3781 3783 3791 3802 3803 3808 3839 3864 3865 3893 3893 3895 3895 3897 3897 3912 3912 3949 3966 3968 3972 3974 3975 3981 4029 4038 4038 4045 4045 4059 4095 4141 4144 4146 4151 4153 4154 4157 4158 4184 4185 4190 4192 4209 4212 4226 4226 4229 4230 4237 4237 4253 4253 4294 4294 4296 4300 4302 4303 4447 4448 4681 4681 4686 4687 4695 4695 4697 4697 4702 4703 4745 4745 4750 4751 4785 4785 4790 4791 4799 4799 4801 4801 4806 4807 4823 4823 4881 4881 4886 4887 4955 4959 4989 4991 5018 5023 5110 5111 5118 5119 5760 5760 5789 5791 5881 5887 5906 5918 5938 5940 5943 5951 5970 5983 5997 5997 6001 6015 6068 6069 6071 6077 6086 6086 6089 6099 6109 6111 6122 6127 6138 6143 6155 6159 6170 6175 6265 6271 6277 6278 6313 6313 6315 6319 6390 6399 6431 6434 6439 6440 6444 6447 6450 6450 6457 6463 6465 6467 6510 6511 6517 6527 6572 6575 6602 6607 6619 6621 6679 6680 6683 6685 6742 6742 6744 6752 6754 6754 6757 6764 6771 6783 6794 6799 6810 6815 6830 6915 6964 6973 6978 6980 6989 6989 7019 7027 7040 7041 7074 7077 7080 7085 7142 7142 7144 7145 7149 7149 7151 7163 7212 7219 7222 7226 7242 7244 7307 7311 7355 7356 7368 7378 7380 7392 7394 7400 7405 7405 7412 7412 7416 7417 7419 7423 7616 7679 7958 7959 7966 7967 8006 8007 8014 8015 8024 8024 8026 8026 8028 8028 8030 8030 8062 8063 8117 8117 8133 8133 8148 8149 8156 8156 8176 8177 8181 8181 8191 8207 8232 8239 8287 8303 8306 8307 8335 8335 8349 8351 8386 8447 8588 8591 9258 9279 9291 9311 11124 11125 11503 11505 11508 11512 11558 11558 11560 11564 11566 11567 11624 11630 11633 11647 11671 11679 11687 11687 11695 11695 11703 11703 11711 11711 11719 11719 11727 11727 11735 11735 11743 11775 11870 11903 11930 11930 12020 12031 12246 12271 12288 12288 12330 12335 12352 12352 12439 12442 12544 12548 12592 12592 12644 12644 12687 12687 12774 12782 12831 12831 42125 42127 42183 42191 42540 42559 42607 42610 42612 42621 42654 42655 42736 42737 42744 42751 42973 42992 43010 43010 43014 43014 43019 43019 43045 43046 43052 43055 43066 43071 43128 43135 43204 43213 43226 43249 43263 43263 43302 43309 43335 43345 43347 43358 43389 43394 43443 43443 43446 43449 43452 43453 43456 43456 43470 43470 43482 43485 43493 43493 43519 43519 43561 43566 43569 43570 43573 43583 43587 43587 43596 43596 43598 43599 43610 43611 43644 43644 43696 43696 43698 43700 43703 43704 43710 43711 43713 43713 43715 43738 43756 43757 43766 43776 43783 43784 43791 43792 43799 43807 43815 43815 43823 43823 43884 43887 44005 44005 44008 44008 44013 44015 44026 44031 55204 55215 55239 55242 55292 55295 57344 63743 64110 64111 64218 64255 64263 64274 64280 64284 64286 64286 64311 64311 64317 64317 64319 64319 64322 64322 64325 64325 64976 65007 65024 65039 65050 65071 65107 65107 65127 65127 65132 65135 65141 65141 65277 65280 65438 65440 65471 65473 65480 65481 65488 65489 65496 65497 65501 65503 65511 65511 65519 65531 65534 65535 65548 65548 65575 65575 65595 65595 65598 65598 65614 65615 65630 65663 65787 65791 65795 65798 65844 65846 65935 65935 65949 65951 65953 65999 66045 66175 66205 66207 66257 66272 66300 66303 66340 66348 66379 66383 66422 66431 66462 66462 66500 66503 66518 66559 66718 66719 66730 66735 66772 66775 66812 66815 66856 66863 66916 66926 66939 66939 66955 66955 66963 66963 66966 66966 66978 66978 66994 66994 67002 67002 67005 67007 67060 67071 67383 67391 67414 67423 67432 67455 67462 67462 67505 67505 67515 67583 67590 67591 67593 67593 67638 67638 67641 67643 67645 67646 67670 67670 67743 67750 67760 67807 67827 67827 67830 67834 67868 67870 67898 67902 67930 67967 68024 68027 68048 68049 68097 68111 68116 68116 68120 68120 68150 68159 68169 68175 68185 68191 68256 68287 68325 68330 68343 68351 68406 68408 68438 68439 68467 68471 68498 68504 68509 68520 68528 68607 68681 68735 68787 68799 68851 68857 68900 68911 68922 68927 68966 68973 68998 69005 69008 69215 69247 69247 69290 69292 69294 69295 69298 69313 69320 69327 69337 69375 69416 69423 69446 69456 69466 69487 69506 69509 69514 69551 69580 69599 69623 69631 69633 69633 69688 69702 69710 69713 69744 69744 69747 69748 69750 69761 69811 69814 69817 69818 69821 69821 69826 69839 69865 69871 69882 69890 69927 69931 69933 69941 69960 69967 70003 70003 70007 70017 70070 70078 70080 70080 70089 70092 70095 70095 70112 70112 70133 70143 70162 70162 70191 70193 70196 70199 70206 70206 70209 70271 70279 70279 70281 70281 70286 70286 70302 70302 70314 70319 70367 70367 70371 70383 70394 70401 70404 70404 70413 70414 70417 70418 70441 70441 70449 70449 70452 70452 70458 70460 70462 70462 70464 70464 70469 70470 70473 70474 70477 70479 70481 70492 70500 70527 70538 70538 70540 70541 70543 70543 70582 70582 70584 70584 70587 70601 70603 70603 70606 70608 70610 70610 70614 70614 70617 70655 70712 70719 70722 70724 70726 70726 70748 70748 70750 70750 70754 70783 70832 70832 70835 70840 70842 70842 70845 70845 70847 70848 70850 70851 70856 70863 70874 71039 71087 71087 71090 71095 71100 71101 71103 71104 71132 71167 71219 71226 71229 71229 71231 71232 71237 71247 71258 71263 71277 71295 71339 71339 71341 71341 71344 71351 71354 71359 71370 71375 71396 71423 71451 71453 71455 71455 71458 71461 71463 71471 71495 71679 71727 71735 71737 71738 71740 71839 71923 71934 71943 71944 71946 71947 71956 71956 71959 71959 71984 71984 71990 71990 71993 71998 72003 72003 72007 72015 72026 72095 72104 72105 72148 72155 72160 72160 72165 72191 72193 72202 72243 72248 72251 72254 72263 72271 72273 72278 72281 72283 72330 72342 72344 72345 72355 72367 72441 72447 72458 72544 72546 72548 72550 72550 72552 72639 72674 72687 72698 72703 72713 72713 72752 72765 72767 72767 72774 72783 72813 72815 72848 72872 72874 72880 72882 72883 72885 72959 72967 72967 72970 72970 73009 73029 73031 73039 73050 73055 73062 73062 73065 73065 73103 73106 73109 73109 73111 73111 73113 73119 73130 73135 73180 73183 73194 73439 73459 73460 73465 73473 73489 73489 73526 73533 73536 73538 73562 73647 73649 73663 73714 73726 74650 74751 74863 74863 74869 74879 75076 77711 77811 77823 78896 78912 78919 78943 82939 82943 83527 90367 90398 90409 90413 90415 90426 92159 92729 92735 92767 92767 92778 92781 92863 92863 92874 92879 92910 92916 92918 92927 92976 92982 92998 93007 93018 93018 93026 93026 93048 93052 93072 93503 93562 93759 93851 93855 93881 93882 93908 93951 94027 94031 94088 94098 94112 94175 94180 94193 94199 94207 101590 101630 101663 101759 101875 110575 110580 110580 110588 110588 110591 110591 110883 110897 110899 110927 110931 110932 110934 110947 110952 110959 111356 113663 113771 113775 113789 113791 113801 113807 113818 113819 113821 113822 113824 117759 118013 118015 118452 118457 118481 118495 118513 118607 118724 118783 119030 119039 119079 119080 119141 119145 119149 119170 119173 119179 119210 119213 119275 119295 119362 119364 119366 119487 119508 119519 119540 119551 119639 119647 119673 119807 119893 119893 119965 119965 119968 119969 119971 119972 119975 119976 119981 119981 119994 119994 119996 119996 120004 120004 120070 120070 120075 120076 120085 120085 120093 120093 120122 120122 120127 120127 120133 120133 120135 120137 120145 120145 120486 120487 120780 120781 121344 121398 121403 121452 121461 121461 121476 121476 121484 122623 122655 122660 122667 122927 122990 123135 123181 123190 123198 123199 123210 123213 123216 123535 123566 123583 123628 123631 123642 123646 123648 124111 124140 124143 124154 124367 124398 124399 124411 124414 124416 124607 124639 124639 124643 124643 124646 124646 124654 124655 124661 124669 124672 124895 124903 124903 124908 124908 124911 124911 124927 124927 125125 125126 125136 125183 125252 125258 125260 125263 125274 125277 125280 126064 126133 126208 126270 126463 126468 126468 126496 126496 126499 126499 126501 126502 126504 126504 126515 126515 126520 126520 126522 126522 126524 126529 126531 126534 126536 126536 126538 126538 126540 126540 126544 126544 126547 126547 126549 126550 126552 126552 126554 126554 126556 126556 126558 126558 126560 126560 126563 126563 126565 126566 126571 126571 126579 126579 126584 126584 126589 126589 126591 126591 126602 126602 126620 126624 126628 126628 126634 126634 126652 126703 126706 126975 127020 127023 127124 127135 127151 127152 127168 127168 127184 127184 127222 127231 127406 127461 127491 127503 127548 127551 127561 127567 127570 127583 127590 127743 128729 128731 128749 128751 128765 128767 128986 128991 129004 129007 129009 129023 129036 129039 129096 129103 129114 129119 129160 129167 129198 129199 129212 129215 129218 129231 129241 129279 129624 129631 129646 129647 129661 129663 129675 129677 129735 129735 129737 129740 129757 129758 129771 129774 129785 129791 129939 129939 130043 131071 173792 173823 178206 178207 183982 183983 191457 191471 192094 194559 195102 196607 201547 201551 210042 `1114111`" 20 global jlt uint 126976 21 global jkc uint 512 22 global jki uint 1024 23 global jdg uint 2048 24 global jkn ulong 3 25 global jrs uchar `8388608` 26 global jrsl ulong 1 27 global jrq uchar `4194304` 28 global jrql ulong 1 29 global jrl uchar `12582912` 30 global jrll ulong 1 31 global jrn uchar `6291456` 32 global jrnl ulong 1 33 global jtro ulong 1 34 global jtrl ulong 1 35 global jrdl ulong 1 36 note ---- tables: jlt[cp] = lowercase of cp (0 = unchanged) for cp < 126976 (no mapping above) ---- 37 fn ru_init to void 38 p = ulong 0 39 for r ulong 185 40 p = num_tnum jtlr p 41 s = get jtv 0 42 p = num_tnum jtlr p 43 c = get jtv 0 44 p = num_tnum jtlr p 45 d = get jtv 0 46 ng = eq get jts 0 1 47 p = num_tnum jtlr p 48 st = get jtv 0 49 for t ulong c 50 cp = add s mul t st 51 lc = add cp d 52 if ng 53 lc = sub cp d 54 end 55 put jlt cp uint lc 56 end 57 end 58 p = 0 59 for r ulong 302 60 p = num_tnum jtkc p 61 put jkc r uint get jtv 0 62 end 63 p = 0 64 for r ulong 928 65 p = num_tnum jtki p 66 put jki r uint get jtv 0 67 end 68 p = 0 69 for r ulong 1822 70 p = num_tnum jtdbg p 71 put jdg r uint get jtv 0 72 end 73 put jkn 0 151 74 put jkn 1 464 75 put jkn 2 911 76 end 77 note true when cp lies in one of the sorted [lo,hi] pairs of table w: 0 cased (jkc), 1 case-ignorable 78 note (jki), 2 escaped by (jdg) 79 fn ru_inr cp uint w uchar to bool 80 lo = ulong 0 81 hi = get jkn ulong w 82 for it ulong 12 83 if ge lo hi 84 ret false 85 end 86 md = div add lo hi 2 87 a = uint 0 88 b = uint 0 89 if eq w 0 90 a = get jkc mul md 2 91 b = get jkc add mul md 2 1 92 end 93 if eq w 1 94 a = get jki mul md 2 95 b = get jki add mul md 2 1 96 end 97 if eq w 2 98 a = get jdg mul md 2 99 b = get jdg add mul md 2 1 100 end 101 if lt cp a 102 hi = md 103 else 104 if gt cp b 105 lo = add md 1 106 else 107 ret true 108 end 109 end 110 end 111 ret false 112 end 113 note decode the UTF-8 scalar at jrs[i] (length -> jrdl); an ill-formed byte decodes as `4294967295`, length 1 114 fn ru_dec i ulong n ulong to uint 115 c = uint get jrs i 116 put jrdl 0 1 117 if lt c 128 118 ret c 119 end 120 k = ulong 0 121 v = uint 0 122 if eq and c 224 192 123 k = 1 124 v = and c 31 125 end 126 if eq and c 240 224 127 k = 2 128 v = and c 15 129 end 130 if eq and c 248 240 131 k = 3 132 v = and c 7 133 end 134 if or eq k 0 gt add i k sub n 1 135 ret `4294967295` 136 end 137 for t ulong k 138 b = uint get jrs add add i t 1 139 if ne and b 192 128 140 ret `4294967295` 141 end 142 v = or shl v 6 and b 63 143 end 144 put jrdl 0 add k 1 145 ret v 146 end 147 fn ru_isws cp uint to bool 148 if and ge cp 9 le cp 13 149 ret true 150 end 151 if or or eq cp 32 eq cp 133 or eq cp 160 eq cp 5760 152 ret true 153 end 154 if and ge cp 8192 le cp 8202 155 ret true 156 end 157 if or or eq cp 8232 eq cp 8233 or or eq cp 8239 eq cp 8287 eq cp 12288 158 ret true 159 end 160 ret false 161 end 162 note str::trim (char::is_whitespace) of jrs[off .. off+n) -> jtro (start), jtrl (length); an all-blank 163 note input gives start off, length 0 (Rust trim_matches with no rejected char) 164 fn ru_trim off ulong n ulong to void 165 e = add off n 166 p = off 167 for it ulong `8388609` 168 if ge p e 169 break 170 end 171 cp = ru_dec p e 172 if not ru_isws cp 173 break 174 end 175 p = add p get jrdl 0 176 end 177 if ge p e 178 put jtro 0 off 179 put jtrl 0 0 180 ret 181 end 182 for it ulong `8388609` 183 if le e p 184 break 185 end 186 s = sub e 1 187 for t ulong 3 188 if le s p 189 break 190 end 191 if ne and get jrs s 192 128 192 break 193 end 194 s = sub s 1 195 end 196 cp = ru_dec s e 197 if ne add s get jrdl 0 e 198 break 199 end 200 if not ru_isws cp 201 break 202 end 203 e = s 204 end 205 put jtro 0 p 206 put jtrl 0 sub e p 207 end 208 note sigma context class of the char ending before i (dir false) or starting at i (dir true), skipping 209 note case-ignorable chars: true when the first other char is cased 210 fn ru_ctx i ulong n ulong dir bool to bool 211 for it ulong `8388609` 212 cp = uint 0 213 if dir 214 if ge i n 215 ret false 216 end 217 cp = ru_dec i n 218 i = add i get jrdl 0 219 else 220 if eq i 0 221 ret false 222 end 223 s = sub i 1 224 for t ulong 3 225 if eq s 0 226 break 227 end 228 if ne and get jrs s 192 128 229 break 230 end 231 s = sub s 1 232 end 233 cp = ru_dec s n 234 if ne add s get jrdl 0 i 235 cp = `4294967295` 236 s = sub i 1 237 end 238 i = s 239 end 240 if not ru_inr cp 1 241 ret ru_inr cp 0 242 end 243 end 244 ret false 245 end 246 note encode scalar v as UTF-8 into jrl at o; returns new o 247 fn ru_enc v uint o ulong to ulong 248 if lt v 128 249 put jrl o uchar v 250 ret add o 1 251 end 252 if lt v 2048 253 put jrl o uchar or 192 shr v 6 254 put jrl add o 1 uchar or 128 and v 63 255 ret add o 2 256 end 257 if lt v 65536 258 put jrl o uchar or 224 shr v 12 259 put jrl add o 1 uchar or 128 and shr v 6 63 260 put jrl add o 2 uchar or 128 and v 63 261 ret add o 3 262 end 263 put jrl o uchar or 240 shr v 18 264 put jrl add o 1 uchar or 128 and shr v 12 63 265 put jrl add o 2 uchar or 128 and shr v 6 63 266 put jrl add o 3 uchar or 128 and v 63 267 ret add o 4 268 end 269 note lowercase one non-ASCII char of jrs at i (n = end) into jrl at o; returns (new i << 32) | new o 270 fn ru_lmb i ulong n ulong o ulong to ulong 271 cp = ru_dec i n 272 k = get jrdl 0 273 if eq cp 931 274 lc = uint 963 275 if ru_ctx i n false 276 if not ru_ctx add i 2 n true 277 lc = 962 278 end 279 end 280 o = ru_enc lc o 281 ret or shl add i 2 32 o 282 end 283 if eq cp 304 284 put jrl o 105 285 put jrl add o 1 204 286 put jrl add o 2 135 287 ret or shl add i 2 32 add o 3 288 end 289 if lt cp 126976 290 lc = get jlt cp 291 if ne lc 0 292 o = ru_enc lc o 293 ret or shl add i k 32 o 294 end 295 end 296 for t ulong k 297 put jrl add o t get jrs add i t 298 end 299 ret or shl add i k 32 add o k 300 end 301 note str::to_lowercase of jrs[0 .. jrsl) -> jrl[0 .. jrll) 302 fn ru_lower to void 303 num_init 304 n = get jrsl 0 305 o = ulong 0 306 i = ulong 0 307 for b ulong 4000 308 for t ulong 4000 309 if ge i n 310 put jrll 0 o 311 ret 312 end 313 c = get jrs i 314 if lt c 128 315 if and ge c 65 le c 90 316 c = add c 32 317 end 318 put jrl o c 319 o = add o 1 320 i = add i 1 321 else 322 r = ru_lmb i n o 323 i = shr r 32 324 o = and r `4294967295` 325 end 326 end 327 end 328 put jrll 0 o 329 end 330 note needle: lowercase jrq[0 .. jrql) into jrn (uses jrs/jrl as scratch) 331 fn ru_prep to void 332 n = get jrql 0 333 ru_cpqs n false 334 put jrsl 0 n 335 ru_lower 336 m = get jrll 0 337 ru_cpqs m true 338 put jrnl 0 m 339 end 340 note lower(jrs).contains(lower(jrq)) with the needle prepared by ru_prep 341 fn ru_contains to bool 342 ru_lower 343 m = get jrnl 0 344 h = get jrll 0 345 if eq m 0 346 ret true 347 end 348 if gt m h 349 ret false 350 end 351 f = get jrn 0 352 last = sub h m 353 i = ulong 0 354 for b ulong 4000 355 for t ulong 4000 356 if gt i last 357 ret false 358 end 359 if eq get jrl i f 360 if ru_meq i m 361 ret true 362 end 363 end 364 i = add i 1 365 end 366 end 367 ret false 368 end 369 fn ru_meq i ulong m ulong to bool 370 k = ulong 0 371 for b ulong 4000 372 for t ulong 4000 373 if ge k m 374 ret true 375 end 376 x = get jrn k 377 if ne get jrl add i k x 378 ret false 379 end 380 k = add k 1 381 end 382 end 383 ret true 384 end 385 note copy n bytes: sel false jrq -> jrs, true jrl -> jrn 386 fn ru_cpqs n ulong sel bool to void 387 i = ulong 0 388 for b ulong 4000 389 for t ulong 4000 390 if ge i n 391 ret 392 end 393 if sel 394 x = get jrl i 395 put jrn i x 396 else 397 x = get jrq i 398 put jrs i x 399 end 400 i = add i 1 401 end 402 end 403 end 404