Skip to content

Commit

Permalink
Updates for pylexertl
Browse files Browse the repository at this point in the history
  • Loading branch information
BenHanson committed May 6, 2024
1 parent 2d2d135 commit bca1359
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions include/lexertl/rules.hpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ namespace lexertl
push_state(initial());
}

// Added to support python bindings
virtual ~basic_rules()
{
}

void clear()
{
_statemap.clear();
Expand Down Expand Up @@ -118,7 +123,7 @@ namespace lexertl
return static_cast<id_type>(~1);
}

id_type eoi() const
static id_type eoi()
{
return 0;
}
Expand Down Expand Up @@ -325,9 +330,17 @@ namespace lexertl
}

// Add rule with id
// Separate overloads to support python bindings
void push(const rules_char_type* curr_dfa_,
const rules_char_type* regex_, const id_type id_,
const rules_char_type* new_dfa_, const id_type user_id_ = npos())
const rules_char_type* new_dfa_)
{
push(curr_dfa_, string(regex_), id_, new_dfa_, npos());
}

void push(const rules_char_type* curr_dfa_,
const rules_char_type* regex_, const id_type id_,
const rules_char_type* new_dfa_, const id_type user_id_)
{
push(curr_dfa_, string(regex_), id_, new_dfa_, user_id_);
}
Expand Down

0 comments on commit bca1359

Please sign in to comment.