Skip to content

Commit f2dfb52

Browse files
author
Hana Dusíková
committed
Merge branch 'main' of github.com:hanickadot/compile-time-regular-expressions into main
2 parents 09c7fc4 + 2626fea commit f2dfb52

File tree

4 files changed

+4
-3
lines changed

4 files changed

+4
-3
lines changed

include/ctll/fixed_string.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ template <size_t N> struct fixed_string {
118118
if (info.length == 2) {
119119
if (++i < N) {
120120
if ((input[i] & 0b1111'1100'0000'0000) == 0b1101'1100'0000'0000) {
121-
content[out++] = (info.value << 10) | (input[i] & 0b0000'0011'1111'1111);
121+
content[out++] = ((info.value << 10) | (input[i] & 0b0000'0011'1111'1111)) + 0x10000;
122122
} else {
123123
correct_flag = false;
124124
break;

single-header/ctre-unicode.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ template <size_t N> struct fixed_string {
353353
if (info.length == 2) {
354354
if (++i < N) {
355355
if ((input[i] & 0b1111'1100'0000'0000) == 0b1101'1100'0000'0000) {
356-
content[out++] = (info.value << 10) | (input[i] & 0b0000'0011'1111'1111);
356+
content[out++] = ((info.value << 10) | (input[i] & 0b0000'0011'1111'1111)) + 0x10000;
357357
} else {
358358
correct_flag = false;
359359
break;

single-header/ctre.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ template <size_t N> struct fixed_string {
350350
if (info.length == 2) {
351351
if (++i < N) {
352352
if ((input[i] & 0b1111'1100'0000'0000) == 0b1101'1100'0000'0000) {
353-
content[out++] = (info.value << 10) | (input[i] & 0b0000'0011'1111'1111);
353+
content[out++] = ((info.value << 10) | (input[i] & 0b0000'0011'1111'1111)) + 0x10000;
354354
} else {
355355
correct_flag = false;
356356
break;

tests/_fixed-string.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ static_assert(ctll::fixed_string(u8"😍")[0] == L'😍');
2626
// u"" is utf-16
2727
static_assert(ctll::fixed_string(u"ěšč").size() == 3);
2828
static_assert(ctll::fixed_string(u"😍").size() == 1);
29+
static_assert(ctll::fixed_string(u"😍").is_same_as(ctll::fixed_string(U"😍")));
2930

3031
// U"" is utf-32
3132
static_assert(ctll::fixed_string(U"ěšč").size() == 3);

0 commit comments

Comments
 (0)