-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: parse triple backtick strings, discarding the info header (#1162)
This is a more LLM-reliable way to get codegen outputs We should add a documentation guide page for this (possibly a great community contribution candidate here), but in the meantime I've drafted up a blog post <!-- ELLIPSIS_HIDDEN --> ---- > [!IMPORTANT] > Add support for parsing triple backtick strings in JSON parser, including dedenting and discarding info headers. > > - **Behavior**: > - Add `TripleBacktickString` variant to `JsonCollection` in `json_collection.rs` to handle triple backtick strings. > - Update `process_token()` in `json_parse_state.rs` to parse triple backtick strings, discarding the info header and dedenting content. > - **Utilities**: > - Move `dedent` function to `dedent.rs` in `bstd` and update its usage in `expression.rs` and `json_collection.rs`. > - **Tests**: > - Add tests in `test_code.rs` to verify parsing of triple backtick strings, including edge cases like nested backticks and dedenting. > > <sup>This description was created by </sup>[<img alt="Ellipsis" src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=BoundaryML%2Fbaml&utm_source=github&utm_medium=referral)<sup> for 3d5cd23. It will automatically update as commits are pushed.</sup> <!-- ELLIPSIS_HIDDEN -->
- Loading branch information
Showing
10 changed files
with
565 additions
and
102 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.