Fix in tokenizer, fixes SpartanJ/ecode#275.

This commit is contained in:
Martín Lucas Golini
2024-05-08 12:55:15 -03:00
parent f49e16c50e
commit 2664dabfaf

View File

@@ -194,8 +194,7 @@ _tokenize( const SyntaxDefinition& syntax, const std::string& text, const Syntax
SyntaxState retState = state;
SyntaxStateRestored curState = SyntaxTokenizer::retrieveSyntaxState( syntax, state );
size_t size = !text.empty() ? ( text[text.size() - 1] == '\n' ? text.size() - 1 : text.size() )
: 0; // skip last char ( new line char )
size_t size = text.size();
std::string patternStr;
std::string patternText;