mirror of
https://github.com/yhirose/cpp-peglib.git
synced 2024-12-23 04:15:31 +00:00
Fixed sample examples in README
This commit is contained in:
parent
347113d4fd
commit
523137c5dd
@ -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]*
|
||||||
|
Loading…
Reference in New Issue
Block a user