aboutsummaryrefslogtreecommitdiffstats
path: root/libparser.c
diff options
context:
space:
mode:
Diffstat (limited to 'libparser.c')
-rw-r--r--libparser.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/libparser.c b/libparser.c
index 36b662d..cb5981b 100644
--- a/libparser.c
+++ b/libparser.c
@@ -112,6 +112,18 @@ try_match(const char *rule, const union libparser_sentence *sentence, struct con
}
break;
+ case LIBPARSER_SENTENCE_TYPE_REJECTION:
+ unit->in = try_match(NULL, sentence->unary.sentence, ctx);
+ if (unit->in) {
+ free_unit(unit->in, ctx);
+ if (!ctx->exception)
+ goto mismatch;
+ ctx->exception = 0;
+ }
+ ctx->position = unit->start;
+ unit->rule = NULL;
+ break;
+
case LIBPARSER_SENTENCE_TYPE_OPTIONAL:
unit->in = try_match(NULL, sentence->unary.sentence, ctx);
goto prone;