mirror of
https://github.com/yhirose/cpp-peglib.git
synced 2024-12-22 11:55:30 +00:00
Fix for u8 char C++20 incompatibility
C++20 apparently doesn't allow std::string construction from u8 literals any more. The pre-20 behavior is restored by explicitly casting the new `char_8_t` back to `char`.
This commit is contained in:
parent
e362ce7423
commit
2561fd182d
2
peglib.h
2
peglib.h
@ -3035,7 +3035,7 @@ private:
|
|||||||
cls("0-9a-fA-F"), cls("0-9a-fA-F")),
|
cls("0-9a-fA-F"), cls("0-9a-fA-F")),
|
||||||
seq(npd(chr('\\')), dot()));
|
seq(npd(chr('\\')), dot()));
|
||||||
|
|
||||||
g["LEFTARROW"] <= seq(cho(lit("<-"), lit(u8"←")), g["Spacing"]);
|
g["LEFTARROW"] <= seq(cho(lit("<-"), lit(reinterpret_cast<const char*>(u8"←"))), g["Spacing"]);
|
||||||
~g["SLASH"] <= seq(chr('/'), g["Spacing"]);
|
~g["SLASH"] <= seq(chr('/'), g["Spacing"]);
|
||||||
~g["PIPE"] <= seq(chr('|'), g["Spacing"]);
|
~g["PIPE"] <= seq(chr('|'), g["Spacing"]);
|
||||||
g["AND"] <= seq(chr('&'), g["Spacing"]);
|
g["AND"] <= seq(chr('&'), g["Spacing"]);
|
||||||
|
Loading…
Reference in New Issue
Block a user