Fixed sample examples in README

This commit is contained in:
Yuji Hirose 2019-09-04 15:59:40 -04:00
parent 347113d4fd
commit 523137c5dd

View File

@ -170,7 +170,7 @@ auto ret = pg.parse(" token1, token2 ");
We can ignore unnecessary semantic values from the list by using `~` operator. We can ignore unnecessary semantic values from the list by using `~` operator.
```cpp ```cpp
peg::pegparser parser(R"( peg::parser parser(R"(
ROOT <- _ ITEM (',' _ ITEM _)* ROOT <- _ ITEM (',' _ ITEM _)*
ITEM <- ([a-z])+ ITEM <- ([a-z])+
~_ <- [ \t]* ~_ <- [ \t]*
@ -186,7 +186,7 @@ auto ret = parser.parse(" item1, item2 ");
The following grammar is same as the above. The following grammar is same as the above.
```cpp ```cpp
peg::pegparser parser(R"( peg::parser parser(R"(
ROOT <- ~_ ITEM (',' ~_ ITEM ~_)* ROOT <- ~_ ITEM (',' ~_ ITEM ~_)*
ITEM <- ([a-z])+ ITEM <- ([a-z])+
_ <- [ \t]* _ <- [ \t]*