mirror of https://github.com/KLayout/klayout.git
Fixed #898 (netlist reader ignores last list)
This commit is contained in:
parent
93e789a861
commit
ab3bceda75
|
|
@ -662,7 +662,7 @@ NetlistSpiceReader::SpiceReaderStream::close ()
|
||||||
std::pair<std::string, bool>
|
std::pair<std::string, bool>
|
||||||
NetlistSpiceReader::SpiceReaderStream::get_line ()
|
NetlistSpiceReader::SpiceReaderStream::get_line ()
|
||||||
{
|
{
|
||||||
if (mp_text_stream->at_end ()) {
|
if (at_end ()) {
|
||||||
return std::make_pair (std::string (), false);
|
return std::make_pair (std::string (), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -708,7 +708,7 @@ NetlistSpiceReader::SpiceReaderStream::source () const
|
||||||
bool
|
bool
|
||||||
NetlistSpiceReader::SpiceReaderStream::at_end () const
|
NetlistSpiceReader::SpiceReaderStream::at_end () const
|
||||||
{
|
{
|
||||||
return mp_text_stream->at_end ();
|
return !m_has_stored_line && mp_text_stream->at_end ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
|
|
@ -590,3 +590,24 @@ TEST(15_ContinuationWithBlanks)
|
||||||
"end;\n"
|
"end;\n"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST(16_issue898)
|
||||||
|
{
|
||||||
|
db::Netlist nl;
|
||||||
|
|
||||||
|
std::string path = tl::combine_path (tl::combine_path (tl::testdata (), "algo"), "issue-898.cir");
|
||||||
|
|
||||||
|
db::NetlistSpiceReader reader;
|
||||||
|
tl::InputStream is (path);
|
||||||
|
reader.read (is, nl);
|
||||||
|
|
||||||
|
EXPECT_EQ (nl.to_string (),
|
||||||
|
"circuit .TOP ();\n"
|
||||||
|
" device RES $1 (A=VDD,B=GND) (R=1000,L=0,W=0,A=0,P=0);\n"
|
||||||
|
" subcircuit FILLER_CAP '0' (VDD=VDD,GND=GND);\n"
|
||||||
|
"end;\n"
|
||||||
|
"circuit FILLER_CAP (VDD=VDD,GND=GND);\n"
|
||||||
|
" device NMOS '0' (S=GND,G=VDD,D=GND,B=GND) (L=10,W=10,AS=0,AD=0,PS=0,PD=0);\n"
|
||||||
|
"end;\n"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue