Skip to content

Conversation

Seven-Streams
Copy link
Collaborator

This PR supports compile_structural_tag and from_structural_tag with a Format as the parameter. For example, in the main branch, if we want to use from_structrual_tag with a StructuralTag, we must:

stag_format = ...
stag = xgr.StructuralTag(format=stag_format)
grammar = xgr.Grammar.from_structural_tag(stag)
...

Now, we can:

stag_format = ...
grammar = xgr.Grammar.from_structural_tag(stag_format)

And it should be more convinient.

@Seven-Streams Seven-Streams marked this pull request as draft October 10, 2025 01:07
Signed-off-by: Yuchuan <[email protected]>
Signed-off-by: Yuchuan <[email protected]>
@Seven-Streams Seven-Streams marked this pull request as ready for review October 10, 2025 02:35
stag_format: xgr.structural_tag.Format, instance: str, is_accepted: bool
):
check_stag_with_instance_in_format_style(stag_format, instance, is_accepted)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update with check_stag_with_instance

@Ubospica
Copy link
Collaborator

Close this because we need to send StructuralTag instead of Format to compiler

@Ubospica Ubospica closed this Oct 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants