#include <list>
#include <stack>
#include <vector>
+#include <msp/core/except.h>
#include "format.h"
#include "regex.h"
Regex::Regex(const string &expr)
{
- n_groups = 0;
auto iter = expr.begin();
code = compile(expr, iter, n_groups, false);
++n_groups;
Count repeat_min = 1;
Count repeat_max = 1;
- parse_repeat(expr, i, repeat_min, repeat_max);
+ if(i!=end)
+ parse_repeat(expr, i, repeat_min, repeat_max);
for(unsigned j=0; j<repeat_min; ++j)
result += atom;
input_consumed = true;
}
else
- throw logic_error("invalid instruction in regex bytecode");
+ throw internal_error("invalid instruction in regex bytecode");
if(match_result==negate_match)
terminate = true;