Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions include/ctpg/ctpg.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2940,7 +2940,6 @@ class parser<
}

ps.current_term_idx = res.term_idx;
ps.current_end_it = ps.current_it + res.len;

if (ps.current_term_idx == uninitialized16)
{
Expand All @@ -2949,6 +2948,7 @@ class parser<
}
else
{
ps.current_end_it = ps.current_it + res.len;
trace_recognized_term(ps);
}

Expand Down Expand Up @@ -3487,7 +3487,13 @@ namespace regex
constexpr bool match(match_options opts, const Buffer& buf, Stream& s) const
{
auto res = dfa_match(sm, opts, source_point{}, buf.begin(), buf.end(), s);
auto end = buf.begin() + res.len;

typename Buffer::iterator end;
if (res.len == uninitialized16)
end = buf.end();
else
end = buf.begin() + res.len;

if (res.term_idx == 0 && end == buf.end())
return true;
else
Expand Down