Skip to content

Commit

Permalink
Rename to state_type.
Browse files Browse the repository at this point in the history
  • Loading branch information
SharafMohamed committed Dec 8, 2024
1 parent 7cd39f0 commit a4a93b4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/log_surgeon/finite_automata/RegexDFAState.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class RegexDFAState;
using RegexDFAByteState = RegexDFAState<RegexDFAStateType::Byte>;
using RegexDFAUTF8State = RegexDFAState<RegexDFAStateType::UTF8>;

template <RegexDFAStateType stateType>
template <RegexDFAStateType state_type>
class RegexDFAState {
public:
using Tree = UnicodeIntervalTree<RegexDFAState*>;
Expand Down Expand Up @@ -49,14 +49,14 @@ class RegexDFAState {
private:
std::vector<uint32_t> m_matching_variable_ids;
RegexDFAState* m_bytes_transition[cSizeOfByte];
// NOTE: We don't need m_tree_transitions for the `stateType == RegexDFAStateType::Byte` case,
// NOTE: We don't need m_tree_transitions for the `state_type == RegexDFAStateType::Byte` case,
// so we use an empty class (`std::tuple<>`) in that case.
std::conditional_t<stateType == RegexDFAStateType::UTF8, Tree, std::tuple<>> m_tree_transitions;
std::conditional_t<state_type == RegexDFAStateType::UTF8, Tree, std::tuple<>> m_tree_transitions;
};

template <RegexDFAStateType stateType>
auto RegexDFAState<stateType>::next(uint32_t character) const -> RegexDFAState* {
if constexpr (RegexDFAStateType::Byte == stateType) {
template <RegexDFAStateType state_type>
auto RegexDFAState<state_type>::next(uint32_t character) const -> RegexDFAState* {
if constexpr (RegexDFAStateType::Byte == state_type) {
return m_bytes_transition[character];
} else {
if (character < cSizeOfByte) {
Expand Down

0 comments on commit a4a93b4

Please sign in to comment.