From 5117001a9c436dd5ff96915ee1fc27136112378c Mon Sep 17 00:00:00 2001 From: stefan schippers Date: Thu, 16 Nov 2023 00:02:25 +0100 Subject: [PATCH] revert changes: `allow tcleval() in node alias names` and `allow tcleval(xxxx) in % dataset specification on graph nodes`: just wrap the whole list of nodes (including aliases, % specifications et all) into a tcleval(...) --- src/draw.c | 8 ++++---- src/xschem.tcl | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/draw.c b/src/draw.c index 4e46233d..9865a780 100644 --- a/src/draw.c +++ b/src/draw.c @@ -2750,14 +2750,14 @@ static void draw_graph_variables(int wcnt, int wave_color, int n_nodes, int swee /* draw node labels in graph */ if(bus_msb) { if(gr->unity != 1.0) my_snprintf(tmpstr, S(tmpstr), "%s[%c]", - tcl_hook2(find_nth(ntok, ";,", "\"", 0, 1)), gr->unity_suffix); - else my_snprintf(tmpstr, S(tmpstr), "%s",tcl_hook2(find_nth(ntok, ";,", "\"", 0, 1))); + find_nth(ntok, ";,", "\"", 0, 1), gr->unity_suffix); + else my_snprintf(tmpstr, S(tmpstr), "%s",find_nth(ntok, ";,", "\"", 0, 1)); } else { char *ntok_ptr = NULL; char *alias_ptr = NULL; dbg(1, "ntok=%s\n", ntok); if(strstr(ntok, ";")) { - my_strdup2(_ALLOC_ID_, &alias_ptr, tcl_hook2(find_nth(ntok, ";", "\"", 0, 1))); + my_strdup2(_ALLOC_ID_, &alias_ptr, find_nth(ntok, ";", "\"", 0, 1)); my_strdup2(_ALLOC_ID_, &ntok_ptr, find_nth(ntok, ";", "\"", 0, 2)); } else { @@ -3349,7 +3349,7 @@ void draw_graph(int i, const int flags, Graph_ctx *gr, void *ct) my_free(_ALLOC_ID_, &node_rawfile); my_free(_ALLOC_ID_, &node_sim_type); } - if(pos == 2) node_dataset = atoi(tcl_hook2(nd)); + if(pos == 2) node_dataset = atoi(nd); else node_dataset = -1; dbg(1, "nd=|%s|, node_dataset = %d\n", nd, node_dataset); my_strdup(_ALLOC_ID_, &ntok_copy, find_nth(ntok, "%", "\"", 4, 1)); diff --git a/src/xschem.tcl b/src/xschem.tcl index 3f344fb8..358d7081 100644 --- a/src/xschem.tcl +++ b/src/xschem.tcl @@ -2276,12 +2276,12 @@ proc graph_update_nodelist {} { set col [xschem getprop rect 2 $graph_selected color] set col [string trim $col " \n"] - set regx {(?:(tcleval\()?"[^"]+"\)?)|(?:(tcleval\()?[^\n \t]+\)?)} + set regx {(?:tcleval\(\n*)?("[^"]+"|[^ \t\n)]+)(?:\))?} set txt [.graphdialog.center.right.text1 get 1.0 {end - 1 chars}] set tt {} set cc {} set start 0 - while {[regexp -indices -start $start $regx $txt idx]} { + while {[regexp -indices -start $start $regx $txt idxall idx]} { lappend tt [lindex $idx 0] set start [expr {[lindex $idx 1] + 1}] lappend cc $start