Clarify require_match functionality

This commit is contained in:
Wilson Lin 2018-08-04 16:56:03 +12:00
parent 577637c59a
commit 9148946802
1 changed files with 7 additions and 1 deletions

View File

@ -388,7 +388,13 @@ hb_char_t hbu_pipe_require_predicate(hbu_pipe_t pipe, hbu_pipe_predicate_t pred,
}
void hbu_pipe_require_match(hbu_pipe_t pipe, const char *match) {
if (!hbu_pipe_matches(pipe, match)) {
if (!hbu_pipe_accept_if_matches(pipe, match)) {
hbe_fatal(HBE_PARSE_EXPECTED_NOT_FOUND, "Expected %s at %s", match, hbu_pipe_generate_pos_msg(pipe));
}
}
void hbu_pipe_require_skip_match(hbu_pipe_t pipe, const char *match) {
if (!hbu_pipe_skip_if_matches(pipe, match)) {
hbe_fatal(HBE_PARSE_EXPECTED_NOT_FOUND, "Expected %s at %s", match, hbu_pipe_generate_pos_msg(pipe));
}
}