Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc

# Enable beta playground features in the standalone web app by default.
export NEXT_PUBLIC_FIDDLE_BETA_DEFAULT=true

# speed up building the Ruby client library, which I think defaults to the release build
export RB_SYS_CARGO_PROFILE="dev"

Expand Down
2 changes: 2 additions & 0 deletions engine/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions engine/baml-compiler/src/codegen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -496,8 +496,13 @@ impl<'g> HirCompiler<'g> {
// Locals come after.
names.resize_with(names.capacity(), String::new);

log::info!("There are {} locals loremipsum", locals.len());

// Distribute locals to their respective indexes.
for (name, index) in locals {
if *index >= names.len() {
break;
}
names[*index] = name.to_string();
}

Expand Down
1 change: 1 addition & 0 deletions engine/baml-lib/ast/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ either.workspace = true
test-log.workspace = true
pretty = { workspace = true }
regex.workspace = true
indexmap.workspace = true

[dev-dependencies]
pretty_assertions.workspace = true
Expand Down
10 changes: 8 additions & 2 deletions engine/baml-lib/ast/examples/generate_mermaid_headers.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::path::Path;

use internal_baml_ast::{parse, BamlVisDiagramGenerator};
use internal_baml_ast::{diagram_generator, parse};
use internal_baml_diagnostics::SourceFile;

fn main() {
Expand Down Expand Up @@ -33,6 +33,12 @@ fn main() {
}

// Nicely styled header graph
let mermaid = BamlVisDiagramGenerator::generate_with_styling(&ast, true);
let mermaid = diagram_generator::generate_with_styling(
diagram_generator::MermaidGeneratorContext {
use_fancy: true,
function_filter: None,
},
&ast,
);
println!("{mermaid}");
}
8 changes: 2 additions & 6 deletions engine/baml-lib/ast/src/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,22 @@ mod type_builder_block;
mod type_expression_block;
mod value_expression_block;

pub mod baml_vis;
pub mod header_collector;
pub mod mermaid_debug;
mod baml_vis;
pub use app::App;
pub use argument::{Argument, ArgumentId, ArgumentsList};
pub use assignment::Assignment;
pub use attribute::{Attribute, AttributeContainer, AttributeId};
pub use baml_vis::BamlVisDiagramGenerator;
pub use baml_vis::{diagram_generator, mermaid_debug::MermaidDiagramGenerator};
pub use config::ConfigBlockProperty;
pub use expr::{ExprFn, TopLevelAssignment};
pub use expression::{
BinaryOperator, ClassConstructor, ClassConstructorField, Expression, ExpressionBlock,
RawString, UnaryOperator,
};
pub use field::{Field, FieldArity, FieldType};
pub use header_collector::{HeaderCollector, HeaderIndex, RenderableHeader, ScopeId};
pub use identifier::{Identifier, RefIdentifier};
pub use indentation_type::IndentationType;
pub use internal_baml_diagnostics::Span;
pub use mermaid_debug::MermaidDiagramGenerator;
pub use newline_type::NewlineType;
pub use stmt::{
AssertStmt, AssignOp, AssignOpStmt, AssignStmt, CForLoopStmt, ExprStmt, ForLoopStmt, Header,
Expand Down
Loading
Loading