From 71d194071b22ac8bf7fcc472266b3028a16a556d Mon Sep 17 00:00:00 2001 From: Mikolaj Wielgus Date: Sun, 27 Nov 2022 06:16:15 +0100 Subject: [PATCH] Sim: Allow Numparam expressions in models inside subckts Global-level numparam expressions are not properly supported yet. Fixes https://gitlab.com/kicad/code/kicad/issues/12953 --- eeschema/sim/spice_grammar.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/eeschema/sim/spice_grammar.h b/eeschema/sim/spice_grammar.h index 1a7fcfee6a..0d1e3d9bde 100644 --- a/eeschema/sim/spice_grammar.h +++ b/eeschema/sim/spice_grammar.h @@ -94,6 +94,11 @@ namespace SPICE_GRAMMAR struct dotModelType : plus {}; + struct numparamBracedExpr : seq, + star>>, + one<'}'>> {}; + // Ngspice has some heuristic logic to allow + and - in tokens. We replicate that here. struct tokenStart : seq>, opt {}; struct paramValuePair : seq inline constexpr auto errorMessage = "expected newline not followed by a line continuation"; template <> inline constexpr auto errorMessage = - "expected token separator (typ. one or more whitespace, parenthesis, '=', ',', line continuation)"; + "expected token separator (one or more whitespace, parenthesis, '=', ',', line continuation)"; template <> inline constexpr auto errorMessage> = ""; template <> inline constexpr auto errorMessage = "expected model name"; template <> inline constexpr auto errorMessage = "expected model type";