diff --git a/README.md b/README.md index 232b7c2..6b3969a 100644 --- a/README.md +++ b/README.md @@ -144,9 +144,9 @@ We can ignore unnecessary semantic values from the list by using `~` operator. ```c++ peglib::peg parser( - " ROOT <- _ ITEM (',' _ ITEM _)* " - " ITEM <- ([a-z])+ " - " ~_ <- [ \t]* " + " ROOT <- _ ITEM (',' _ ITEM _)* " + " ITEM <- ([a-z])+ " + " ~_ <- [ \t]* " ); parser["ROOT"] = [&](const SemanticValues& sv) { @@ -156,6 +156,16 @@ parser["ROOT"] = [&](const SemanticValues& sv) { auto ret = parser.parse(" item1, item2 "); ``` +The following grammar is same as the above. + +```c++ +peglib::peg parser( + " ROOT <- ~_ ITEM (',' ~_ ITEM ~_)* " + " ITEM <- ([a-z])+ " + " _ <- [ \t]* " +); +``` + Simple interface ----------------