[Bugfix][Structured Output] Reject unsupported regex inside groups (#60359)
Signed-off-by: Shreyansh Jain <shreyanshjain646@gmail.com> Signed-off-by: Artem Perevedentsev <aperevedents@nvidia.com> Co-authored-by: Artem Perevedentsev <aperevedents@nvidia.com>
This commit is contained in:
co-authored by
Artem Perevedentsev
parent
b027ac8312
commit
28d76f3bad
@@ -327,9 +327,11 @@ def _check_unsupported(parsed) -> None:
|
||||
for branch in tval[1]:
|
||||
_check_unsupported(branch)
|
||||
|
||||
# tval is (min, max, subpattern)
|
||||
elif ttype == _parser.MAX_REPEAT:
|
||||
_check_unsupported(tval[2])
|
||||
else:
|
||||
nested = tval if isinstance(tval, tuple) else (tval,)
|
||||
for sub in nested:
|
||||
if isinstance(sub, _parser.SubPattern):
|
||||
_check_unsupported(sub)
|
||||
|
||||
|
||||
def validate_regex_is_buildable(pattern: str) -> None:
|
||||
|
||||
Reference in New Issue
Block a user