Supported .

This commit is contained in:
yhirose 2016-01-23 22:15:15 -05:00
parent 5b88443270
commit ae400aa218
3 changed files with 3 additions and 4 deletions

View File

@ -386,7 +386,7 @@ assert(g.parse(" Hello BNF! "));
Unicode support
---------------
Since cpp-peglib only accepts 8 bits characters, it probably accepts UTF-8 text. But `.` matches only a byte, not a Unicode character. Also, it dosn't support `\u????`.
Since cpp-peglib only accepts 8 bits characters, it probably accepts UTF-8 text. But `.` matches only a byte, not a Unicode character. Also, it dosn't support `\u????`.
Sample codes
------------
@ -408,7 +408,6 @@ TODO
----
* Unicode support (`.` matches a Unicode char. `\u????`, `\p{L}`)
* Allow `←` and `ε`
License
-------

View File

@ -1810,7 +1810,7 @@ private:
seq(lit("\\x"), cls("0-9a-fA-F"), opt(cls("0-9a-fA-F"))),
seq(npd(chr('\\')), dot()));
g["LEFTARROW"] <= seq(lit("<-"), g["Spacing"]);
g["LEFTARROW"] <= seq(cho(lit("<-"), lit("")), g["Spacing"]);
~g["SLASH"] <= seq(chr('/'), g["Spacing"]);
g["AND"] <= seq(chr('&'), g["Spacing"]);
g["NOT"] <= seq(chr('!'), g["Spacing"]);

View File

@ -8,7 +8,7 @@
TEST_CASE("Simple syntax test", "[general]")
{
peg::parser parser(
" ROOT <- _ "
" ROOT _ "
" _ <- ' ' "
);