-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement tests for dynamic types #1343
Merged
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
ba7fe42
Grammar
antoniosarosi 765f06f
Parser
antoniosarosi 80d164c
Remove `SPACER_TEXT` from `type_builder_block` grammar
antoniosarosi 726ea22
Parse `type_builder_block` in `value_expression_block`
antoniosarosi dde691a
Add type alias to `parse_block` test
antoniosarosi abd4284
Refactor branching in `parse_value_expression_block`
antoniosarosi fe1d5ac
Merge branch 'canary' into antonio/dynamic-types-tests
antoniosarosi 3f00ac5
Report error when `type_builder` is not allowed
antoniosarosi deef90b
Report error on multiple type builder blocks
antoniosarosi 9cd53e4
AST hack
antoniosarosi 33e60c0
Add validation test for missing `@@dynamic`
antoniosarosi f9074d1
Rename validation tests & add test for type aliases
antoniosarosi c9ebc55
Add validations for `@@dyanmic` attr
antoniosarosi 9af1206
Fix dynamic attr check
antoniosarosi 334d99f
Remove debug print statements
antoniosarosi e5eb0b3
Avoid name collisions in cloned ASTs
antoniosarosi 44af158
Merge branch 'canary' into antonio/dynamic-types-tests
antoniosarosi 53c8992
Support recursive type aliases in type builder blocks
antoniosarosi f685948
Explain hack
antoniosarosi 771fb61
Merge branch 'canary' into antonio/dynamic-types-tests
antoniosarosi 7209a65
Render prompt in real time
antoniosarosi 5da0bfa
Fix `BLOCK_LEVEL_CATCH_ALL` in parser
antoniosarosi 06105d0
Validate multiple `dynamic` defs for same type
antoniosarosi a3d33de
Validate cycles introduced by type builder blocks
antoniosarosi 6c72696
VSCode syntax
antoniosarosi 5ee049c
Lezer syntax
antoniosarosi e89e0f6
Fix typo
antoniosarosi bfe4f04
Allow any variant for dynamic enums
antoniosarosi 7b0afc1
Merge branch 'canary' into antonio/dynamic-types-tests
antoniosarosi 483363d
Don't panic :)
antoniosarosi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,6 +34,9 @@ RUN curl https://mise.run | sh \ | |
# Install Rust | ||
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | ||
|
||
# Install WASM tools | ||
RUN cargo install [email protected] wasm-pack | ||
|
||
# Install Infisical | ||
RUN curl -1sLf 'https://dl.cloudsmith.io/public/infisical/infisical-cli/setup.deb.sh' | sudo -E bash \ | ||
&& sudo apt update && sudo apt install -y infisical |
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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this morally the same behavior that already exists for
Class
argument coersion in the case of dynamic types? https://github.com/BoundaryML/baml/pull/1343/files#diff-5fa0605b8093a86ff1b1b8e89032c02d46a052907bfa6dc38032c3ffc37aca02R238 I'm not sure, but it is. Just double-checking.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it's the same behavior. I think it makes sense, if you have a dynamic enum and add variants to it at runtime, you would not be able to pass those variants to functions if the coercer doesn't allow it. We might want to restrict both classes and enums to only values added at runtime or in type builder blocks, but for now this does the job.