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(
315
315
const string_view src = unprocessedStringToken.text ;
316
316
const size_t tail = src.size ();
317
317
318
- // Max parsing length set to max annotation length
319
- if (tail > maxParsingLength)
320
- return {unprocessedStringToken};
321
-
322
318
vector<InstructionTextToken> result;
323
319
size_t curStart = 0 , curEnd = 0 ;
324
320
@@ -403,6 +399,20 @@ static vector<InstructionTextToken> ParseStringToken(
403
399
{
404
400
curEnd++;
405
401
}
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
+ }
406
416
}
407
417
408
418
flushToken (curStart, curEnd);
You can’t perform that action at this time.
0 commit comments