-
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.
Adds the ability to specify constraints on types at the block level, like this: ``` class Foo { length_bound int baz string @@Assert( valid_bound, {{ this.baz|length < this.length_bound }} ) } ``` TODO: - [x] Integration tests for functions returning top-level block constraints - [x] Integration tests for function returning classes with block-level constraints on nested classes - [x] Integrations tests for function paramerts with block-level constraints - [x] Integration tests for function parameters with nested block-level constraint fields - [x] Documentation (Validations.mdx page and Reference) <!-- ELLIPSIS_HIDDEN --> ---- > [!IMPORTANT] > Adds block-level constraints for types, updates constraint handling logic, and includes integration tests for the new functionality. > > - **Behavior**: > - Adds block-level constraints for types, allowing constraints at the class level. > - Updates constraint handling logic in `ir_helpers/mod.rs` and `coercer/field_type.rs`. > - Adds functions `distribute_constraints`, `type_has_constraints`, and `type_has_checks` in `ir_helpers/mod.rs`. > - **Tests**: > - Adds integration tests for block-level constraints in `integ-tests/typescript/tests/integ-tests.test.ts`. > - Tests include handling of nested block-level constraints and function parameters with block-level constraints. > - **Misc**: > - Updates `Cargo.toml` and `Cargo.lock` to include `itertools` dependency. > - Minor updates to `BamlValueWithMeta` serialization in `baml_value.rs`. > > <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 d21f1aa. It will automatically update as commits are pushed.</sup> <!-- ELLIPSIS_HIDDEN -->
- Loading branch information
1 parent
b8a221f
commit e931acb
Showing
49 changed files
with
1,839 additions
and
1,844 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.