From 0008991f0291854e78b69e54fc619b0b441234be Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sun, 12 May 2024 15:37:34 +0100 Subject: [PATCH] Support multiple brace-expressions for CPL model lines. (Nested brace-expressions, on the other hand, are *not* an ngspice thing.) Fixes https://gitlab.com/kicad/code/kicad/-/issues/17824 --- eeschema/sim/spice_grammar.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/eeschema/sim/spice_grammar.h b/eeschema/sim/spice_grammar.h index e8b4aa5ed7..fa9787abe6 100644 --- a/eeschema/sim/spice_grammar.h +++ b/eeschema/sim/spice_grammar.h @@ -104,8 +104,7 @@ namespace SPICE_GRAMMAR one<']'>> {}; struct bracedExpr : seq, - star>>, + star>, one<'}'>> {}; // Ngspice has some heuristic logic to allow + and - in tokens. We replicate that here. @@ -123,10 +122,11 @@ namespace SPICE_GRAMMAR // Param names cannot be `token` because LTspice models contain spurious values without // parameter names, which we need to skip, and because tokens can include a very limited // subset of un-braced expressions + // Note: we must support lists of both braced expressions and tokens for CPL models. struct param : identifier {}; - struct paramValue : sor, vectorExpr, - token> {}; + list> {}; struct paramValuePair : seq