From 9e5d2ebddfb29af853a252594729bf8afbb70591 Mon Sep 17 00:00:00 2001 From: John Kerl Date: Fri, 25 Nov 2016 16:37:22 -0500 Subject: [PATCH] neaten --- c/containers/mlhmmv.c | 13 +++++-------- c/dsls/mlr_dsl_parse.y | 2 +- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/c/containers/mlhmmv.c b/c/containers/mlhmmv.c index 825c1b159..5e80ce8bc 100644 --- a/c/containers/mlhmmv.c +++ b/c/containers/mlhmmv.c @@ -289,15 +289,12 @@ void mlhmmv_xvalues_to_lrecs_lashed(mlhmmv_xvalue_t** ptop_values, int num_subma } sllv_append(poutrecs, poutrec); } else { - // xxx need to update this for the more general oosvar/localvar/mapliteral cases. - - // E.g. '@v = {...}' at the top level of the mlhmmv: the map value keyed by - // oosvar-name 'v' is itself a hashmap. This needs to be flattened down to an - // lrec which is a list of key-value pairs. We recursively invoke - // mlhhmv_levels_to_lrecs_lashed_across_records for each of the name-list entries, - // one map level deeper each call, then from there invoke + // E.g. '@v = {...}' at the top level of the map, where the map is an oosvar + // submap keyed by oosvar-name 'v', or a localvar value, or a map literal. This + // needs to be flattened down to an lrec which is a list of key-value pairs. We + // recursively invoke mlhhmv_levels_to_lrecs_lashed_across_records for each of the + // name-list entries, one map level deeper each call, then from there invoke // mlhhmv_levels_to_lrecs_lashed_within_records on any remaining map levels. - lrec_t* ptemplate = lrec_unbacked_alloc(); mlhmmv_level_t** ppnext_levels = mlr_malloc_or_die(num_submaps * sizeof(mlhmmv_level_t*)); diff --git a/c/dsls/mlr_dsl_parse.y b/c/dsls/mlr_dsl_parse.y index 9dada36b7..d339f1abf 100644 --- a/c/dsls/mlr_dsl_parse.y +++ b/c/dsls/mlr_dsl_parse.y @@ -516,7 +516,7 @@ md_for_loop_index(A) ::= MD_TOKEN_BOOLEAN MD_TOKEN_NON_SIGIL_NAME(B). { A = mlr_dsl_ast_node_alloc(B->text, MD_AST_NODE_TYPE_BOOLEAN_LOCAL_DEFINITION); } -md_for_map_keylist(A) ::= md_for_loop_index(K). { // xxx rename +md_for_map_keylist(A) ::= md_for_loop_index(K). { A = mlr_dsl_ast_node_alloc_unary("key_variables", MD_AST_NODE_TYPE_FOR_VARIABLES, K); } md_for_map_keylist(A) ::= md_for_map_keylist(L) MD_TOKEN_COMMA md_for_loop_index(K). {