From 4813ad123086b916fca01e2911e70db2b8074c1d Mon Sep 17 00:00:00 2001 From: katherine Date: Sun, 12 May 2019 17:04:41 -0700 Subject: check for at fewest one variable rule --- src/parse.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/parse.c b/src/parse.c index 4a6aff8..ce255bb 100644 --- a/src/parse.c +++ b/src/parse.c @@ -367,6 +367,11 @@ struct parse_result_s parse(FILE *f, const char *fname) ERR_AT(t.line, t.col, "unexpected token `%s`", t.val); } + if (r.vars == NULL) { + fprintf(stderr, "\e[1m%s:\e[0m ", fname); + ERR("config must specify at fewest one variable rule"); + } + HASH_ITER(hh, r.vars, vcur, vtmp) { switch (vcur->type) { case PARSE_TYPE_DEFTYPE: -- cgit v1.2.3