From a3a4d4409c492f3be5ba6293dfb1ae77b18c52b6 Mon Sep 17 00:00:00 2001 From: h_vogt Date: Sat, 19 Jun 2010 18:50:39 +0000 Subject: [PATCH] .measure skip braces in a special case --- ChangeLog | 2 ++ src/frontend/inpcom.c | 12 +++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 7a372c52b..c3829a969 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,8 @@ 2010-06-19 Holger Vogt * subckt.c: line indentations com_measure2.c: remove bug, see support tracker no. 3013968 + inpcom.c: no braces around out_variable3 in + .MEASURE {DC|AC|TRAN} result FIND out_variable WHEN out_variable2=out_variable3 2010-06-19 Robert Larice * ng-spice-rework/src/xspice/Makefile.am: diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index b4cb31b45..7dbe9845d 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -2675,7 +2675,7 @@ static void inp_fix_param_values( struct line *deck ) { struct line *c = deck; - char *line, *beg_of_str, *end_of_str, *old_str, *equal_ptr, *new_str; + char *line, *beg_of_str, *end_of_str, *old_str, *equal_ptr, *new_str, *tmp_str; char *vec_str, *natok, *buffer, *newvec, *whereisgt; bool control_section = FALSE, has_paren = FALSE; int n = 0; @@ -2711,6 +2711,16 @@ inp_fix_param_values( struct line *deck ) while ( ( equal_ptr = strstr( line, "=" ) ) ) { + // special case: .MEASURE {DC|AC|TRAN} result FIND out_variable WHEN out_variable2=out_variable3 + // no braces around out_variable3. out_variable3 may be v(...) or i(...) + if ( ciprefix( ".meas", line )) + if ((( *(equal_ptr+1) == 'v' ) || ( *(equal_ptr+1) == 'i' )) && ( *(equal_ptr+2) == '(' )) { + // find closing ')' and skip token v(...) or i(...) + while (( equal_ptr) && *equal_ptr != ')') equal_ptr++; + line = equal_ptr + 1; + continue; + } + // skip over equality '==' if ( *(equal_ptr+1) == '=' ) { line += 2; continue; } // check for '!=', '<=', '>='