@@ -2756,9 +2756,7 @@ inline size_t Holder::parse_core(const char *s, size_t n, SemanticValues &vs,
2756
2756
auto ope_ptr = ope_.get ();
2757
2757
{
2758
2758
auto tok_ptr = dynamic_cast <const peg::TokenBoundary *>(ope_ptr);
2759
- if (tok_ptr) {
2760
- ope_ptr = tok_ptr->ope_ .get ();
2761
- }
2759
+ if (tok_ptr) { ope_ptr = tok_ptr->ope_ .get (); }
2762
2760
}
2763
2761
if (!dynamic_cast <const peg::PrioritizedChoice *>(ope_ptr)) {
2764
2762
chvs.choice_count_ = 0 ;
@@ -4538,8 +4536,8 @@ class parser {
4538
4536
const char *path = nullptr ) const {
4539
4537
if (grammar_ != nullptr ) {
4540
4538
const auto &rule = (*grammar_)[start_];
4541
- return post_process (s, n,
4542
- rule. parse_and_get_value (s, n, dt, val, path, log_) );
4539
+ auto result = rule. parse_and_get_value (s, n, dt, val, path, log_);
4540
+ return post_process (s, n, result );
4543
4541
}
4544
4542
return false ;
4545
4543
}
@@ -4685,7 +4683,7 @@ class parser {
4685
4683
inline void enable_tracing (parser &parser, std::ostream &os) {
4686
4684
parser.enable_trace (
4687
4685
[&](auto &ope, auto s, auto , auto &, auto &c, auto &, auto &trace_data) {
4688
- auto prev_pos = std::any_cast<size_t >(trace_data);
4686
+ auto prev_pos = std::any_cast<size_t >(trace_data);
4689
4687
auto pos = static_cast <size_t >(s - c.s );
4690
4688
auto backtrack = (pos < prev_pos ? " *" : " " );
4691
4689
std::string indent;
@@ -4809,8 +4807,8 @@ inline void enable_profiling(parser &parser, std::ostream &os) {
4809
4807
" Total counters" );
4810
4808
os << buff << std::endl;
4811
4809
4812
- snprintf (buff, BUFSIZ, " %4s %10s %5s %10.2f %10.2f %s" , " " ,
4813
- " " , " " , total_success * 100.0 / grand_total,
4810
+ snprintf (buff, BUFSIZ, " %4s %10s %5s %10.2f %10.2f %s" , " " , " " ,
4811
+ " " , total_success * 100.0 / grand_total,
4814
4812
total_fail * 100.0 / grand_total, " % success/fail" );
4815
4813
os << buff << std::endl << std::endl;
4816
4814
;
@@ -4819,8 +4817,8 @@ inline void enable_profiling(parser &parser, std::ostream &os) {
4819
4817
for (auto &[name, success, fail] : stats.items ) {
4820
4818
auto total = success + fail;
4821
4819
auto ratio = total * 100.0 / stats.total ;
4822
- snprintf (buff, BUFSIZ, " %4zu %10zu %5.2f %10zu %10zu %s" ,
4823
- id, total, ratio, success, fail, name.c_str ());
4820
+ snprintf (buff, BUFSIZ, " %4zu %10zu %5.2f %10zu %10zu %s" , id,
4821
+ total, ratio, success, fail, name.c_str ());
4824
4822
os << buff << std::endl;
4825
4823
id++;
4826
4824
}
0 commit comments