From f187640bfff458bfc5c91b875266c5cdf780d1d0 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 30 Nov 2014 09:25:45 +0100 Subject: preparing for include processing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/mds-kbdc/mds-kbdc.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src/mds-kbdc/mds-kbdc.c') diff --git a/src/mds-kbdc/mds-kbdc.c b/src/mds-kbdc/mds-kbdc.c index 55e3587..a2b5b70 100644 --- a/src/mds-kbdc/mds-kbdc.c +++ b/src/mds-kbdc/mds-kbdc.c @@ -39,6 +39,11 @@ */ int main(int argc_, char** argv_) { +#define process(expr) \ + fail_if ((expr) < 0); \ + if (fatal = mds_kbdc_parsed_is_fatal(&result), fatal) \ + goto stop; + mds_kbdc_parsed_t result; int fatal; @@ -46,10 +51,12 @@ int main(int argc_, char** argv_) argv = argv_; mds_kbdc_parsed_initialise(&result); - fail_if (parse_to_tree(argv[1], &result) < 0); - if (fatal = mds_kbdc_parsed_is_fatal(&result), fatal) - goto stop; - fail_if (simplify_tree(&result) < 0); + process (parse_to_tree(argv[1], &result)); + //process (simplify_tree(&result)); + //process (process_includes(&result)); + /* TODO process (validate_tree(&result)); */ + /* TODO process (eliminate_dead_code(&result)); */ + /* TODO process (compile_layout(&result)); */ stop: mds_kbdc_tree_print(result.tree, stderr); mds_kbdc_parsed_print_errors(&result, stderr); @@ -60,5 +67,6 @@ int main(int argc_, char** argv_) xperror(*argv); mds_kbdc_parsed_destroy(&result); return 1; +#undef process } -- cgit v1.2.3-70-g09d2