Should disallow empty clause in grammar parser

This commit is contained in:
Daniel Holden
2014-04-15 16:17:05 +01:00
parent fdee1fb0c6
commit 842835aaa5

4
mpc.c
View File

@@ -2895,7 +2895,7 @@ mpc_parser_t *mpca_grammar_st(const char *grammar, mpca_grammar_st_t *st) {
mpc_soft_delete
));
mpc_define(Term, mpc_many(mpcaf_grammar_and, Factor));
mpc_define(Term, mpc_many1(mpcaf_grammar_and, Factor));
mpc_define(Factor, mpc_and(2, mpcaf_grammar_repeat,
Base,
@@ -3048,7 +3048,7 @@ static mpc_err_t *mpca_lang_st(mpc_input_t *i, mpca_grammar_st_t *st) {
mpc_soft_delete
));
mpc_define(Term, mpc_many(mpcaf_grammar_and, Factor));
mpc_define(Term, mpc_many1(mpcaf_grammar_and, Factor));
mpc_define(Factor, mpc_and(2, mpcaf_grammar_repeat,
Base,