From 0b3383546cd483f3ef7cbd8220557e77617bbd77 Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Sun, 24 Jul 2022 15:54:29 +0200 Subject: [PATCH] Handle .if ... .else ... .endif before .csparam is executed, thus allowing parameter entry to .control section being dependent on .if --- src/frontend/inp.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/frontend/inp.c b/src/frontend/inp.c index 5c873e064..4d9a8743e 100644 --- a/src/frontend/inp.c +++ b/src/frontend/inp.c @@ -882,6 +882,10 @@ inp_spsource(FILE *fp, bool comfile, char *filename, bool intfile) else fprintf(stderr, "Warning: Cannot open file debug-out2.txt for saving debug info\n"); } + + /* handle .if ... .elseif ... .else ... .endif statements. */ + dotifeval(deck); + for (dd = deck; dd; dd = dd->nextcard) { /* get csparams and create vectors, being available in .control section, in plot 'const' */ @@ -902,9 +906,6 @@ inp_spsource(FILE *fp, bool comfile, char *filename, bool intfile) } } - /* handle .if ... .elseif ... .else ... .endif statements. */ - dotifeval(deck); - /* merge the two option line structs com_options (comfile == TRUE, filled in from spinit, .spiceinit, and *ng_sript), and options (comfile == FALSE, filled in from circuit with .OPTIONS)