diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2023-04-07 13:26:41 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2023-04-07 13:26:41 +0300 |
commit | 47200919a70c992685146fdd72c1a2856c15c6b0 (patch) | |
tree | 03270945fd6a8acc2564ea0319bff2fde4b03f4c | |
parent | 65ce68a3a74a7cacb567b22f961d91f584af3e4a (diff) | |
download | gawk-47200919a70c992685146fdd72c1a2856c15c6b0.tar.gz |
Improvements to adump.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | array.c | 23 |
2 files changed, 27 insertions, 2 deletions
@@ -1,3 +1,9 @@ +2023-04-07 Arnold D. Robbins <arnold@skeeve.com> + + * array.c (assoc_info): Update to handle additional cases so + that one may dump SYMTAB or FUNCTAB. Issue reported by + zhou shuiqing <zhoushuiqing321@outlook.com>. + 2023-03-09 Arnold D. Robbins <arnold@skeeve.com> * gawkapi.h: Update copyright year. Small edit in leading comment. @@ -748,10 +748,16 @@ assoc_info(NODE *subs, NODE *val, NODE *ndump, const char *aname) fprintf(output_fp, "]\n"); indent(indent_level); - if (val->type == Node_val) { + switch (val->type) { + case Node_val: fprintf(output_fp, "V: [scalar: "); value_info(val); - } else { + break; + case Node_var: + fprintf(output_fp, "V: [scalar: "); + value_info(val->var_value); + break; + case Node_var_array: fprintf(output_fp, "V: ["); ndump->alevel++; ndump->adepth--; @@ -759,6 +765,19 @@ assoc_info(NODE *subs, NODE *val, NODE *ndump, const char *aname) ndump->adepth++; ndump->alevel--; indent(indent_level); + break; + case Node_func: + fprintf(output_fp, "V: [user_defined_function"); + break; + case Node_ext_func: + fprintf(output_fp, "V: [external_function"); + break; + case Node_builtin_func: + fprintf(output_fp, "V: [builtin_function"); + break; + default: + cant_happen("unexpected node type %s", nodetype2str(val->type)); + break; } fprintf(output_fp, "]\n"); } |