From 51d1f741002cde0a5061faa61d7ccf90d097e101 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 1 Dec 2014 11:36:44 +0100 Subject: mds-kbdc: we cannot at the validation level determine if a value-statment is a set-statement, therefore, we do not validate value-statements yet MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/mds-kbdc/validate-tree.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/mds-kbdc/validate-tree.c b/src/mds-kbdc/validate-tree.c index d835536..05c7555 100644 --- a/src/mds-kbdc/validate-tree.c +++ b/src/mds-kbdc/validate-tree.c @@ -356,19 +356,19 @@ static int validate_assumption(mds_kbdc_tree_assumption_t* restrict tree) static int validate_map(mds_kbdc_tree_map_t* restrict tree) { int is_value = tree->result == NULL; - if (information && is_value) - NEW_ERROR_WITH_INCLUDES(tree, includes_ptr, ERROR, "value-statement inside information clause"); + if (is_value); + /* We do not want value-statments outside function + * definitions, however, we do want \set/3 to be usable, + * from anywhere, even indirectly, therefore we cannot, + * at this process level, determine whether a + * value-statement is used correctly or not. + */ else if (information) NEW_ERROR_WITH_INCLUDES(tree, includes_ptr, ERROR, "mapping-statement inside information clause"); - else if (assumption && is_value) - NEW_ERROR_WITH_INCLUDES(tree, includes_ptr, ERROR, "value-statement inside assumption clause"); else if (assumption) NEW_ERROR_WITH_INCLUDES(tree, includes_ptr, ERROR, "mapping-statement inside assumption clause"); - else if (function && !is_value) + else if (function) NEW_ERROR_WITH_INCLUDES(tree, includes_ptr, ERROR, "mapping-statement inside function definition"); - else if ((function == NULL) && is_value) - NEW_ERROR_WITH_INCLUDES(tree, includes_ptr, ERROR, "value-statement outside function definition"); - /* FIXME \set outside function definition must be supported (warn if inside quotes) */ return 0; pfail: return -1; -- cgit v1.2.3-70-g09d2