From f591d307d9af95bfa0ccda4d5eb76a674447ba39 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Wed, 3 Aug 2016 21:38:50 +0300 Subject: Restore typed regexp code in a new branch. --- debug.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'debug.c') diff --git a/debug.c b/debug.c index f4640adb..a0830621 100644 --- a/debug.c +++ b/debug.c @@ -1736,6 +1736,8 @@ watchpoint_triggered(struct list_item *w) /* new != NULL */ if (t2->type == Node_val) w->cur_value = dupnode(t2); + else if (t2->type == Node_typedregex) + w->cur_value = dupnode(t2); else { w->flags |= CUR_IS_ARRAY; w->cur_size = (t2->type == Node_var_array) ? assoc_length(t2) : 0; @@ -1748,6 +1750,7 @@ watchpoint_triggered(struct list_item *w) w->flags |= CUR_IS_ARRAY; w->cur_size = assoc_length(t2); } else + /* works for Node_typedregex too */ w->cur_value = dupnode(t2); } @@ -1790,6 +1793,8 @@ initialize_watch_item(struct list_item *w) } else if (symbol->type == Node_var_array) { w->flags |= CUR_IS_ARRAY; w->cur_size = assoc_length(symbol); + } else if (symbol->type == Node_typedregex) { + w->cur_value = dupnode(symbol); } /* else can't happen */ } @@ -3704,6 +3709,9 @@ print_memory(NODE *m, NODE *func, Func_print print_func, FILE *fp) print_func(fp, " [%s]", flags2str(m->flags)); break; + case Node_typedregex: + print_func(fp, "@"); + /* fall through */ case Node_regex: pp_string_fp(print_func, fp, m->re_exp->stptr, m->re_exp->stlen, '/', false); break; -- cgit v1.2.3 From b37675aa79213f2665abb2bbb4db90560642bdee Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Tue, 15 Nov 2016 21:03:57 +0200 Subject: First steps reworking code away from node type. --- debug.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'debug.c') diff --git a/debug.c b/debug.c index 70ba82e2..6d591cb5 100644 --- a/debug.c +++ b/debug.c @@ -1736,8 +1736,6 @@ watchpoint_triggered(struct list_item *w) /* new != NULL */ if (t2->type == Node_val) w->cur_value = dupnode(t2); - else if (t2->type == Node_typedregex) - w->cur_value = dupnode(t2); else { w->flags |= CUR_IS_ARRAY; w->cur_size = (t2->type == Node_var_array) ? assoc_length(t2) : 0; @@ -1750,7 +1748,6 @@ watchpoint_triggered(struct list_item *w) w->flags |= CUR_IS_ARRAY; w->cur_size = assoc_length(t2); } else - /* works for Node_typedregex too */ w->cur_value = dupnode(t2); } @@ -1793,7 +1790,7 @@ initialize_watch_item(struct list_item *w) } else if (symbol->type == Node_var_array) { w->flags |= CUR_IS_ARRAY; w->cur_size = assoc_length(symbol); - } else if (symbol->type == Node_typedregex) { + } else if (symbol->type == Node_val && (symbol->flags & REGEX) != 0) { w->cur_value = dupnode(symbol); } /* else can't happen */ @@ -3708,14 +3705,14 @@ print_memory(NODE *m, NODE *func, Func_print print_func, FILE *fp) print_func(fp, "%g", m->numbr); } else if ((m->flags & STRING) != 0) pp_string_fp(print_func, fp, m->stptr, m->stlen, '"', false); - else + else if ((m->flags & REGEX) != 0) { + print_func(fp, "@"); + pp_string_fp(print_func, fp, m->stptr, m->stlen, '/', false); + } else print_func(fp, "-?-"); print_func(fp, " [%s]", flags2str(m->flags)); break; - case Node_typedregex: - print_func(fp, "@"); - /* fall through */ case Node_regex: pp_string_fp(print_func, fp, m->re_exp->stptr, m->re_exp->stlen, '/', false); break; -- cgit v1.2.3