Skip to content

Commit 350ebb2

Browse files
committed
fix.
Signed-off-by: Yuchuan <[email protected]>
1 parent d085ce4 commit 350ebb2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

cpp/grammar_compiler.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ class GrammarMatcherForTokenMaskCache : public EarleyParser {
7777
);
7878

7979
/*!
80-
* \brief Check if speculative calculation will be applied.
80+
* \brief Check if speculative calculation will be applied. It will detect self-recursive-like
81+
* patterns, and utilize them to optimize the token mask calculation.
8182
* \return first: whether speculative calculation is applicable.
8283
* \return second: part of the first character mask,
8384
* which can be used in speculative calculation.
@@ -733,7 +734,7 @@ bool GrammarMatcherForTokenMaskCache::CheckTokensInInterval(
733734
}
734735
}
735736
}
736-
return false;
737+
return fill_reject_indices;
737738
}
738739

739740
/******************* GrammarCompilerNoCache *******************/

0 commit comments

Comments
 (0)