an empty set of `()', a bracket expression, `.', `^', `$',
a `\' followed by a character, or a single character. */
- /* End of regexp? (empty string). */
- if (!*ctx->re)
- goto parse_literal;
-
switch (*ctx->re)
{
case CHAR_LPAREN: /* parenthesized subexpression */
ctx->re++;
goto lparen;
}
- if (!(ctx->cflags & REG_EXTENDED) && *(ctx->re + 1) == CHAR_LPAREN)
+ if (!(ctx->cflags & REG_EXTENDED) && *(ctx->re + 1) == CHAR_RPAREN)
{
goto empty_atom;
}
if (!(ctx->cflags & REG_EXTENDED))
goto parse_literal;
+ case 0:
empty_atom:
result = tre_ast_new_literal(ctx->mem, EMPTY, -1, -1);
if (!result)