- /* We are expecting an atom. If the subexpression (or the whole
- regexp ends here, we interpret it as an empty expression
- (which matches an empty string). */
- if (
- (!*ctx->re
- || *ctx->re == CHAR_STAR
- || (ctx->cflags & REG_EXTENDED
- && (*ctx->re == CHAR_PIPE
- || *ctx->re == CHAR_LBRACE
- || *ctx->re == CHAR_PLUS
- || *ctx->re == CHAR_QUESTIONMARK))
- /* Test for "\)" in BRE mode. */
- || (!(ctx->cflags & REG_EXTENDED)
- && !*(ctx->re + 1)
- && *ctx->re == CHAR_BACKSLASH
- && *(ctx->re + 1) == CHAR_LBRACE)))
- {
- result = tre_ast_new_literal(ctx->mem, EMPTY, -1, -1);
- if (!result)
- return REG_ESPACE;
- break;
- }
-
- wchar_t wc;
- int clen = mbtowc(&wc, ctx->re, -1);