mirror of
https://github.com/yhirose/cpp-peglib.git
synced 2024-12-22 20:05:31 +00:00
Fix #141
This commit is contained in:
parent
86468ec00e
commit
6f73b76c5f
12
peglib.h
12
peglib.h
@ -184,6 +184,10 @@ inline std::u32string decode(const char *s8, size_t l) {
|
|||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <typename T> const char *u8(const T *s) {
|
||||||
|
return reinterpret_cast<const char *>(s);
|
||||||
|
}
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------------
|
/*-----------------------------------------------------------------------------
|
||||||
* escape_characters
|
* escape_characters
|
||||||
*---------------------------------------------------------------------------*/
|
*---------------------------------------------------------------------------*/
|
||||||
@ -3075,9 +3079,7 @@ private:
|
|||||||
seq(g["COMMA"], g["Number"]));
|
seq(g["COMMA"], g["Number"]));
|
||||||
g["Number"] <= seq(oom(cls("0-9")), g["Spacing"]);
|
g["Number"] <= seq(oom(cls("0-9")), g["Spacing"]);
|
||||||
|
|
||||||
g["LEFTARROW"] <=
|
g["LEFTARROW"] <= seq(cho(lit("<-"), lit(u8(u8"←"))), g["Spacing"]);
|
||||||
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"]);
|
||||||
@ -3089,8 +3091,8 @@ private:
|
|||||||
~g["CLOSE"] <= seq(chr(')'), g["Spacing"]);
|
~g["CLOSE"] <= seq(chr(')'), g["Spacing"]);
|
||||||
g["DOT"] <= seq(chr('.'), g["Spacing"]);
|
g["DOT"] <= seq(chr('.'), g["Spacing"]);
|
||||||
|
|
||||||
g["CUT"] <= seq(lit(u8"↑"), g["Spacing"]);
|
g["CUT"] <= seq(lit(u8(u8"↑")), g["Spacing"]);
|
||||||
~g["LABEL"] <= seq(cho(chr('^'), lit(u8"⇑")), g["Spacing"]);
|
~g["LABEL"] <= seq(cho(chr('^'), lit(u8(u8"⇑"))), g["Spacing"]);
|
||||||
|
|
||||||
~g["Spacing"] <= zom(cho(g["Space"], g["Comment"]));
|
~g["Spacing"] <= zom(cho(g["Space"], g["Comment"]));
|
||||||
g["Comment"] <=
|
g["Comment"] <=
|
||||||
|
Loading…
Reference in New Issue
Block a user