File tree 2 files changed +253
-270
lines changed
2 files changed +253
-270
lines changed Original file line number Diff line number Diff line change @@ -3310,7 +3310,20 @@ class ParserGenerator {
3310
3310
}
3311
3311
3312
3312
// For debugging purpose
3313
- static Grammar &grammar () { return get_instance ().g ; }
3313
+ static bool parse_test (const char *d, const char *s) {
3314
+ Data data;
3315
+ std::any dt = &data;
3316
+
3317
+ auto n = strlen (s);
3318
+ auto r = get_instance ().g [d].parse (s, n, dt);
3319
+ return r.ret && r.len == n;
3320
+ }
3321
+
3322
+ #if defined(__cpp_lib_char8_t)
3323
+ static bool parse_test (const char8_t *d, const char8_t *s) {
3324
+ reutnr parse_test (reinterpret_cast <const char *>(s), s);
3325
+ }
3326
+ #endif
3314
3327
3315
3328
private:
3316
3329
static ParserGenerator &get_instance () {
@@ -4086,7 +4099,8 @@ class ParserGenerator {
4086
4099
if (log ) {
4087
4100
auto line = line_info (s, s);
4088
4101
log (line.first , line.second ,
4089
- " The specified start rule '" + requested_start + " ' is undefined." ,
4102
+ " The specified start rule '" + requested_start +
4103
+ " ' is undefined." ,
4090
4104
" " );
4091
4105
}
4092
4106
ret = false ;
You can’t perform that action at this time.
0 commit comments