This commit is contained in:
Meisam Bahadori 2026-08-16 12:05:21 +02:00 committed by Holger Vogt
parent b06275f045
commit ca9e2ec1ff
1 changed files with 11 additions and 0 deletions

View File

@ -775,6 +775,17 @@ inp_spsource(FILE *fp, bool comfile, char *filename, bool intfile)
commands = FALSE;
else
fprintf(cp_err, "Warning: misplaced .endc card\n");
} else if (!commands && ciprefix(".hb", dd->line) &&
(dd->line[3] == '\0' || isspace_c(dd->line[3]))) {
/* Enhancement-162: a top-level `.hb ...` card is run after the
* circuit is parsed as an `hb ...` command (Enhancement-134
* harmonic balance), mirroring the `.sweep` handling above -- drop
* the leading '.' and add it to the post-parse control list. The
* boundary check keeps `.hb` from swallowing any future `.hb*`
* card. */
controls = wl_cons(copy(skip_ws(dd->line) + 1), controls);
ld->nextcard = dd->nextcard;
line_free(dd, FALSE);
} else if (commands || prefix("*#", dd->line)) {
s = dd->line;