Open 4n70w4 opened 4 years ago
Workaround:
Index: debt/vendor/bigwhoop/sentence-breaker/src/Lexing/States/QuotedStringState.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- debt/vendor/bigwhoop/sentence-breaker/src/Lexing/States/QuotedStringState.php (date 1568577024276)
+++ debt/vendor/bigwhoop/sentence-breaker/src/Lexing/States/QuotedStringState.php (date 1568577024276)
@@ -12,6 +12,7 @@
use Bigwhoop\SentenceBreaker\Lexing\Lexer;
use Bigwhoop\SentenceBreaker\Lexing\Tokens\QuotedStringToken;
+use Bigwhoop\SentenceBreaker\Lexing\Tokens\WordToken;
class QuotedStringState extends State
{
@@ -23,11 +24,16 @@
protected function call(Lexer $lexer)
{
$start = $lexer->next();
+ $pos = $lexer->pos();
while (true) {
$next = $lexer->next();
if ($next === null) {
+ $lexer->peek($lexer->pos() - $pos);
+ $lexer->emit(new WordToken());
+
+ return new WordState();
throw new StateException('Failed to find end of quote. Reached end of input. Read: '.$lexer->getTokenValue());
}
Is it worth creating a PR @4n70w4 ?
@jamesgraham I tested it only on my cases. Perhaps I have not checked all cases and something may break.
Text: