From cbfbd3a0de3d09d1877ed403b3d9421fe52e258a Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Thu, 12 Jan 2023 16:49:09 +0000 Subject: [PATCH] Don't attempt to recognize SPICE directives line-by-line. .model and .subckt can be multi-line without requiring the continuation- line syntax. --- .../netlist_exporter_spice.cpp | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/eeschema/netlist_exporters/netlist_exporter_spice.cpp b/eeschema/netlist_exporters/netlist_exporter_spice.cpp index 94b1802123..db72d058db 100644 --- a/eeschema/netlist_exporters/netlist_exporter_spice.cpp +++ b/eeschema/netlist_exporters/netlist_exporter_spice.cpp @@ -393,10 +393,9 @@ void NETLIST_EXPORTER_SPICE::ReadDirectives( unsigned aNetlistOptions ) } catch( const tao::pegtl::parse_error& ) { - // Even if we couldn't parse it, send anything that _looks_ like a directive to - // SPICE + // Even if we couldn't parse it, send anything that _looks_ like it contains + // directives straight through to SPICE wxStringTokenizer tokenizer( text, wxT( "\r\n" ), wxTOKEN_STRTOK ); - bool inDirective = false; while( tokenizer.HasMoreTokens() ) { @@ -404,16 +403,8 @@ void NETLIST_EXPORTER_SPICE::ReadDirectives( unsigned aNetlistOptions ) if( line.StartsWith( "." ) ) { - m_directives.emplace_back( line ); - inDirective = true; - } - else if( inDirective && line.StartsWith( "+" ) ) - { - m_directives.emplace_back( line ); - } - else - { - inDirective = false; + m_directives.emplace_back( text ); + break; } }