Support wildcards in construct
This commit is contained in:
1 parent
892ff89a66
commit
77e1a77e02
2 files changed
+34
-2
No files matched your search
+8
-2
@@ -164,6 +164,13 @@ static void construct_class(fsa_t *out, const regex_class_t *class)
|
||||
}
|
||||
}
|
||||
|
||||
static void construct_wildcard(fsa_t *out)
|
||||
{
|
||||
construct_base(out);
|
||||
for (int i = 0; i < CHAR_COUNT; ++i)
|
||||
fsa_add_rule(out, out->initial, 0, i);
|
||||
}
|
||||
|
||||
static void construct_term(const regex_term_t *term, fsa_t *out)
|
||||
{
|
||||
switch (term->type) {
|
||||
@@ -179,9 +186,8 @@ static void construct_term(const regex_term_t *term, fsa_t *out)
|
||||
case REGEX_TERM_CLASS:
|
||||
construct_class(out, &term->class);
|
||||
break;
|
||||
|
||||
case REGEX_TERM_WILDCARD:
|
||||
assert(false);
|
||||
construct_wildcard(out);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user