From f52a51dce38488789a5c28678e1ba47c7c741b11 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Mon, 13 May 2024 21:28:24 +0100 Subject: [PATCH] Reimplement bracedExpr and token lists for CPL models only. This prevents the incompatibility between token lists and single-token param-value pairs. (cherry picked from commit 086e609c3d3fa5294c4ee798aa98e013f861a08d) --- eeschema/sim/spice_grammar.h | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/eeschema/sim/spice_grammar.h b/eeschema/sim/spice_grammar.h index 9d42df2c2e..2a531cacb1 100644 --- a/eeschema/sim/spice_grammar.h +++ b/eeschema/sim/spice_grammar.h @@ -122,10 +122,8 @@ 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... - // ... but lists of tokens breaks cases where we have single-token name/values. struct param : identifier {}; - struct paramValue : sor>>, + struct paramValue : sor {}; @@ -133,6 +131,16 @@ namespace SPICE_GRAMMAR sep, paramValue> {}; struct paramValuePairs : list {}; + + struct cplSep : opt> {}; + struct cplParamValue : sor, + vectorExpr, + list> {}; + struct cplParamValuePair : seq {}; + struct cplParamValuePairs : list {}; + struct dotModelAko : seq, if_must, opt, newline>> {}; + + struct dotModelCPL : seq, + if_must, + opt, + newline>> {};