mirror of
https://github.com/yhirose/cpp-peglib.git
synced 2024-12-22 11:55:30 +00:00
Fixed documentation.
This commit is contained in:
parent
e6673afa0e
commit
8441a1f104
@ -129,9 +129,11 @@ using namespace std;
|
||||
vector<string> tags;
|
||||
|
||||
Definition ROOT, TAG_NAME, _;
|
||||
ROOT = seq(_, zom(seq(chr('['), TAG_NAME, chr(']'), _)));
|
||||
TAG_NAME = oom(seq(npd(chr(']')), dot())), [&](const char* s, size_t l) { tags.push_back(string(s, l)); };
|
||||
_ = zom(cls(" \t"));
|
||||
ROOT <= seq(_, zom(seq(chr('['), TAG_NAME, chr(']'), _)));
|
||||
TAG_NAME <= oom(seq(npd(chr(']')), dot())), [&](const char* s, size_t l) {
|
||||
tags.push_back(string(s, l));
|
||||
};
|
||||
_ <= zom(cls(" \t"));
|
||||
|
||||
auto ret = ROOT.parse(" [tag1] [tag:2] [tag-3] ");
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user