File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -315,10 +315,6 @@ static vector<InstructionTextToken> ParseStringToken(
315315 const string_view src = unprocessedStringToken.text ;
316316 const size_t tail = src.size ();
317317
318- // Max parsing length set to max annotation length
319- if (tail > maxParsingLength)
320- return {unprocessedStringToken};
321-
322318 vector<InstructionTextToken> result;
323319 size_t curStart = 0 , curEnd = 0 ;
324320
@@ -403,6 +399,20 @@ static vector<InstructionTextToken> ParseStringToken(
403399 {
404400 curEnd++;
405401 }
402+
403+ // Check if we've exceeded max parsing length
404+ if (curEnd > maxParsingLength)
405+ {
406+ // Flush any pending token
407+ flushToken (curStart, maxParsingLength);
408+
409+ // Create single token with remaining text
410+ InstructionTextToken remainingToken = unprocessedStringToken;
411+ remainingToken.text = string (src.substr (maxParsingLength));
412+ remainingToken.width = remainingToken.text .size ();
413+ result.emplace_back (std::move (remainingToken));
414+ return result;
415+ }
406416 }
407417
408418 flushToken (curStart, curEnd);
You can’t perform that action at this time.
0 commit comments