mirror of
https://github.com/yhirose/cpp-peglib.git
synced 2024-12-22 20:05:31 +00:00
Updated enter/leave examples
This commit is contained in:
parent
3a6d202d17
commit
a56ad1cfc2
@ -217,7 +217,7 @@ assert(ret == false);
|
|||||||
*enter* and *leave* actions are also avalable.
|
*enter* and *leave* actions are also avalable.
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
parser["RULE"].enter = [](any& dt) {
|
parser["RULE"].enter = [](const char* s, size_t n, any& dt) {
|
||||||
std::cout << "enter" << std::endl;
|
std::cout << "enter" << std::endl;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -225,7 +225,7 @@ parser["RULE"] = [](const SemanticValues& sv, any& dt) {
|
|||||||
std::cout << "action!" << std::endl;
|
std::cout << "action!" << std::endl;
|
||||||
};
|
};
|
||||||
|
|
||||||
parser["RULE"].leave = [](any& dt) {
|
parser["RULE"].leave = [](const char* s, size_t n, size_t matchlen, any& value, any& dt) {
|
||||||
std::cout << "leave" << std::endl;
|
std::cout << "leave" << std::endl;
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
Loading…
Reference in New Issue
Block a user