Browse Source

inpcom.c, inp_modify_exp(), bug fix, enforce precedence when numparm substitutions come into play

pre-master-46
rlar 12 years ago
parent
commit
5e76305ffa
  1. 4
      src/frontend/inpcom.c
  2. 10
      tests/regression/misc/bugs-1.cir
  3. 2
      tests/regression/misc/bugs-1.out

4
src/frontend/inpcom.c

@ -5577,12 +5577,12 @@ inp_modify_exp(char* expr)
s++;
wl->wl_word = copy(buf);
} else {
wl->wl_word = tprintf("{%s}", buf);
wl->wl_word = tprintf("({%s})", buf);
}
} else {
/* {} around all other tokens */
wl->wl_word = tprintf("{%s}", buf);
wl->wl_word = tprintf("({%s})", buf);
}
}
} else if (isdigit(c) || (c == '.')) { /* allow .5 format too */

10
tests/regression/misc/bugs-1.cir

@ -13,6 +13,14 @@ v1002_aux aux1002 0 DC=3
b1002_t n1002_t 0 V=(-(v(aux1002)))
v1002_g n1002_g 0 -3
.param aux1003=-2
b1003_t n1003_t 0 V='aux1003**2'
v1003_g n1003_g 0 4
b1004_t n1004_t 0 V='-aux1003**2'
v1004_g n1004_g 0 -4
* ----------------------------------------
.control
@ -24,7 +32,7 @@ op
let total_count = 0
let fail_count = 0
let tests = 1001 + vector(2)
let tests = 1001 + vector(4)
foreach n $&tests
set n_test = "n{$n}_t"

2
tests/regression/misc/bugs-1.out

@ -5,4 +5,4 @@ Doing analysis at TEMP = 27.000000 and TNOM = 27.000000
No. of Data Rows : 1
INFO: 0 of 2 tests failed
INFO: 0 of 4 tests failed
Loading…
Cancel
Save