Skip to content

Commit c0480d5

Browse files
authored
fix: push optional-list and optional-map validation to post-parse (#959)
We currently don't allow users to define fields of type `type[]?` or `map<type, type>?`. (This is because the jsonish coercer defaults unset to an empty list/map, rather than an unset.) This validation currently happens at AST parse time, even though there's no technical constraint requiring us to: this is a perfectly parse-able grammar instantiation, and so we should really be doing this validation post-parse, which allows us to also surface diagnostics about other BAML syntax errors. In addition, do a massive cleanup pass over the code: - remove a number of dead codepaths (baml-cli, baml-fmt, `.serialize_data()` which had previously been used for the WASM layer) - flag potentially suspect codepaths (these are now marked with some variant of `TODO` and/or `SUSPECT`) - set `MACOSX_DEPLOYMENT_TARGET` to 10.13 for the primary build (this used to be set in `baml-cli/build.rs` but was dropped in baml-runtime)
1 parent b74ef15 commit c0480d5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+175
-5405
lines changed

engine/.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
# will have compiled files and executables
33
debug/
44
target/
5+
# NOTE(sam): I use this so that rust-analyzer doesn't have to share build directories with
6+
# the cargo build CLI, by setting
7+
# "rust-analyzer.cargo.targetDir": "./target-rust-analyzer",
8+
# in VSCode settings.
9+
target-rust-analyzer/
510

611
# NOTE(sam): I use this on my own laptop, so that `cargo build` doesn't have
712
# to fight rust-analyzer for the build directory lock.

0 commit comments

Comments
 (0)