diff --git a/lib/construct.c b/lib/construct.c index e54bcc6..62bf32d 100644 --- a/lib/construct.c +++ b/lib/construct.c @@ -33,6 +33,8 @@ static void construct_term(const regex_term_t *term, fsa_t *out) case REGEX_TERM_CLASS: assert(false); } + + assert(out->states[0].final); } static void concat_fsas(fsa_t *base, const fsa_t *other) @@ -65,6 +67,8 @@ static void concat_fsas(fsa_t *base, const fsa_t *other) free(other->states[0].rules); free(other->states); + + assert(base->states[0].final); } static void construct_sequence(const regex_sequence_t *seq, fsa_t *out) @@ -77,6 +81,8 @@ static void construct_sequence(const regex_sequence_t *seq, fsa_t *out) construct_term(&seq->contents[i], &term_fsa); concat_fsas(out, &term_fsa); } + + assert(out->states[0].final); } void construct(const regex_t *regex, fsa_t *out)