Updated enter/leave examples

This commit is contained in:
yhirose 2018-09-05 23:15:35 -04:00
parent 3a6d202d17
commit a56ad1cfc2

View File

@ -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;
}; };
``` ```