Updated README

This commit is contained in:
yhirose 2023-04-30 10:29:06 +09:00
parent 17e069fbc5
commit ed84bb7219

View File

@ -247,7 +247,7 @@ assert(ret == false);
*enter* and *leave* actions are also available. *enter* and *leave* actions are also available.
```cpp ```cpp
parser["RULE"].enter = [](const char* s, size_t n, any& dt) { parser["RULE"].enter = [](const Context &c, const char* s, size_t n, any& dt) {
std::cout << "enter" << std::endl; std::cout << "enter" << std::endl;
}; };
@ -255,7 +255,7 @@ parser["RULE"] = [](const SemanticValues& vs, any& dt) {
std::cout << "action!" << std::endl; std::cout << "action!" << std::endl;
}; };
parser["RULE"].leave = [](const char* s, size_t n, size_t matchlen, any& value, any& dt) { parser["RULE"].leave = [](const Context &c, const char* s, size_t n, size_t matchlen, any& value, any& dt) {
std::cout << "leave" << std::endl; std::cout << "leave" << std::endl;
}; };
``` ```