Simulator parser doesn't handle spaces
Description
If the spice model has spaces at the beginning of lines, it is not correctly parsed by the schematic editor parser (error thrown)
Steps to reproduce
- Save the attached spice model as a library
- Attempt to assign it in schematic editor
- See parser error
Note that this library is correctly parsed and used by ngspice
*ZETEX ZXMN2A02N8 Spice Model v2.0 Last Revised 22/2/05
*
.SUBCKT ZXMN2A02N8 30 40 50
*---connections---D-G-S
M1 6 2 7 7 Nmod L=1.16E-6 W=2.3
M2 7 2 7 6 Pmod L=1.3E-6 W=1.3
RG 4 2 1
RIN 2 5 1E12
RD 3 6 Rdmod 0.0045
RS 7 5 Rdmod 0.01
RL 3 5 3E9
C1 2 5 10E-12
C2 3 2 5E-12
D1 5 3 Dbodymod
LD 3 30 1.3E-9
LG 4 40 1.2E-9
LS 5 50 1.2E-9
.MODEL Nmod NMOS (LEVEL=3 TOX=4.5E-8 NSUB=10E16
+VTO=1.365 KP=3.6E-5 NFS=2E11 KAPPA=0.1 UO=650 IS=1E-15 N=10)
.MODEL Pmod PMOS (LEVEL=3 TOX=4.5E-8 NSUB=1.5E16
+TPG=-1 IS=1E-15 N=10)
.MODEL Dbodymod D (IS=2E-11 RS=.015 XTI=1.5 TRS1=1.5e-3 TT=7e-9
+CJO=450e-12 BV=22)
.MODEL Rdmod RES (TC1=3e-3 TC2=6E-6)
.ENDS
KiCad Version
Application: KiCad Schematic Editor x86_64 on x86_64
Version: 7.99.0-4209-g072a693768, debug build
Libraries:
wxWidgets 3.2.2
FreeType 2.12.1
HarfBuzz 6.0.0
FontConfig 2.14.1
Platform: Debian GNU/Linux 12 (bookworm), 64 bit, Little endian, wxGTK, X11, lightdm-xsession, x11
wxWidgets: 3.2.2 (wchar_t,wx containers) GTK+ 3.24
Boost: 1.74.0
OCC: 7.6.3
Curl: 7.88.1
ngspice: 39
Compiler: GCC 12.2.0 with C++ ABI 1017
Build settings:
KICAD_STDLIB_DEBUG=OFF
KICAD_STDLIB_LIGHT_DEBUG=ON
KICAD_SANITIZE_ADDRESS=OFF
KICAD_SANITIZE_THREADS=OFF