diff options
| author | Maxime Coste <mawww@kakoune.org> | 2024-03-22 20:05:43 +1100 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2024-03-22 20:05:43 +1100 |
| commit | 7e75c9a1dfb1e7829fe72599e69ab64356c102c4 (patch) | |
| tree | 5d0887b1f1a57f23c838f274fe1cfea3c70ea375 /src/regex_impl.hh | |
| parent | 2dd69b3d967aea4715746d827b88436822bfc41f (diff) | |
Match Op declaration order in switches
Diffstat (limited to 'src/regex_impl.hh')
| -rw-r--r-- | src/regex_impl.hh | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/regex_impl.hh b/src/regex_impl.hh index d8df2255..d8c39c4d 100644 --- a/src/regex_impl.hh +++ b/src/regex_impl.hh @@ -413,6 +413,14 @@ private: if (pos != config.end and cp != '\n') return consumed(); return failed(); + case CompiledRegex::CharClass: + if (pos == config.end) + return failed(); + return m_program.character_classes[inst.param.character_class_index].matches(cp) ? consumed() : failed(); + case CompiledRegex::CharType: + if (pos == config.end) + return failed(); + return is_ctype(inst.param.character_type, cp) ? consumed() : failed(); case CompiledRegex::Jump: thread.inst = inst.param.jump_target; break; @@ -440,14 +448,6 @@ private: m_saves[thread.saves].pos[inst.param.save_index] = pos; m_saves[thread.saves].valid_mask |= (1 << inst.param.save_index); break; - case CompiledRegex::CharClass: - if (pos == config.end) - return failed(); - return m_program.character_classes[inst.param.character_class_index].matches(cp) ? consumed() : failed(); - case CompiledRegex::CharType: - if (pos == config.end) - return failed(); - return is_ctype(inst.param.character_type, cp) ? consumed() : failed(); case CompiledRegex::LineAssertion: if (not (inst.param.line_start ? is_line_start(pos, config) : is_line_end(pos, config))) return failed(); |
