Index: trunk/src/libcschem/util_parse.c =================================================================== --- trunk/src/libcschem/util_parse.c (revision 2154) +++ trunk/src/libcschem/util_parse.c (revision 2155) @@ -84,23 +84,12 @@ /*** lihata parsers ***/ -int csch_lht_parse_attribs_(csch_sheet_t *sheet, csch_chdr_t *dsth, csch_attribs_t *dsta, csch_source_arg_t src, lht_node_t *subtree, char *src_append_loc, void (*error)(void *ectx, lht_node_t *n, const char *msg), void *ectx) +static void csch_lht_parse_attribs_val(csch_sheet_t *sheet, csch_chdr_t *dsth, csch_attribs_t *dsta, csch_source_arg_t src, lht_node_t *n, char *src_append_loc, void (*error)(void *ectx, lht_node_t *n, const char *msg), void *ectx, int prio) { - lht_node_t *n, *i; - lht_dom_iterator_t it; + lht_node_t *i; long idx; - - if ((subtree == NULL) || (subtree->type != LHT_HASH)) - return 0; - - for(n = lht_dom_first(&it, subtree); n != NULL; n = lht_dom_next(&it)) { - int prio; const char *val; - if (src_append_loc != NULL) - sprintf(src_append_loc, "%d.%d", n->line, n->col); - - prio = CSCH_ATP_USER_DEFAULT; switch(n->type) { case LHT_TEXT: val = n->data.text.value; @@ -126,6 +115,21 @@ default: error(ectx, n, "invalid node type for an attribute"); } +} + +int csch_lht_parse_attribs_(csch_sheet_t *sheet, csch_chdr_t *dsth, csch_attribs_t *dsta, csch_source_arg_t src, lht_node_t *subtree, char *src_append_loc, void (*error)(void *ectx, lht_node_t *n, const char *msg), void *ectx) +{ + lht_node_t *n; + lht_dom_iterator_t it; + + if ((subtree == NULL) || (subtree->type != LHT_HASH)) + return 0; + + for(n = lht_dom_first(&it, subtree); n != NULL; n = lht_dom_next(&it)) { + if (src_append_loc != NULL) + sprintf(src_append_loc, "%d.%d", n->line, n->col); + + csch_lht_parse_attribs_val(sheet, dsth, dsta, src, n, src_append_loc, error, ectx, CSCH_ATP_USER_DEFAULT); } return 0; }