More PEGTL tomfoolery.

This commit is contained in:
Jeff Young 2024-05-13 21:41:40 +01:00
parent 4920c6b00b
commit 8aaca0509c
1 changed files with 15 additions and 14 deletions

View File

@ -156,6 +156,17 @@ namespace SPICE_GRAMMAR
opt<sep>,
newline>> {};
struct dotModelCPL : seq<opt<sep>,
if_must<seq<TAO_PEGTL_ISTRING( ".model" ),
sep,
modelName,
sep,
TAO_PEGTL_ISTRING( "CPL" )>,
opt<sep,
cplParamValuePairs>,
opt<sep>,
newline>> {};
struct dotModel : seq<opt<sep>,
if_must<TAO_PEGTL_ISTRING( ".model" ),
sep,
@ -167,19 +178,6 @@ namespace SPICE_GRAMMAR
opt<sep>,
newline>> {};
struct dotModelCPL : seq<opt<sep>,
if_must<TAO_PEGTL_ISTRING( ".model" ),
sep,
modelName,
sep,
TAO_PEGTL_ISTRING( "CPL" ),
opt<sep,
cplParamValuePairs>,
opt<sep>,
newline>> {};
struct dotSubcktParamValuePair : seq<param,
// TODO: Check if these `star<space>`s match Ngspice's
// behavior.
@ -216,6 +214,7 @@ namespace SPICE_GRAMMAR
struct modelUnit : seq<star<commentLine>,
sor<dotModelAko,
dotModelCPL,
dotModel,
dotSubckt>> {};
@ -305,6 +304,8 @@ namespace SPICE_GRAMMAR
"";
template <> inline constexpr auto errorMessage<opt<sep, paramValuePairs>> =
"";
template <> inline constexpr auto errorMessage<opt<sep, cplParamValuePairs>> =
"";
template <> inline constexpr auto errorMessage<opt<sep, dotSubcktPinSequence>> =
"";
template <> inline constexpr auto errorMessage<opt<sep, dotSubcktParams>> =