Fix parsing of source files that do not end in newline.

This commit is contained in:
Bartosz Taudul 2020-10-28 21:43:03 +01:00
parent 651cfd5c21
commit 0c48956410

View File

@ -488,6 +488,7 @@ void SourceView::ParseSource( const char* fileName, const Worker& worker, const
auto end = txt;
while( *end != '\n' && *end != '\r' && end - m_data < sz ) end++;
m_lines.emplace_back( Line { txt, end, Tokenize( txt, end ) } );
if( end - m_data == sz ) break;
if( *end == '\n' )
{
end++;