Correctly abort the failed grammar requests & Improve the handling of abort (#6803)

This commit is contained in:
Lianmin Zheng
2025-06-01 19:00:07 -07:00
committed by GitHub
parent 6a47b73024
commit 20fd53b8f6
16 changed files with 199 additions and 142 deletions
@@ -60,7 +60,7 @@ class BaseGrammarObject:
raise NotImplementedError()
def copy(self) -> "BaseGrammarObject":
raise NotImplementedError()
return self
@property
def finished(self):
@@ -99,9 +99,12 @@ class BaseGrammarObject:
raise NotImplementedError()
INVALID_GRAMMAR_OBJ = BaseGrammarObject()
@dataclass
class CacheEntry:
value: Optional[BaseGrammarObject]
value: BaseGrammarObject
event: Event