Skip to content

Commit c910f19

Browse files
committed
baml-language: implement new PPIR
baml-language: ppir fixes
1 parent 98d59a1 commit c910f19

62 files changed

Lines changed: 8249 additions & 257 deletions

File tree

Some content is hidden

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

baml_language/crates/baml_base/src/attr.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,20 @@ pub struct TyAttr {
5252
/// not yet complete).
5353
pub sap_in_progress_never: TyAttrValue,
5454
}
55+
56+
impl TyAttr {
57+
/// Return the SAP attribute names that are set on this type.
58+
pub fn attr_names(&self) -> Vec<&'static str> {
59+
let mut names = Vec::new();
60+
if self.sap_parse_without_null == TyAttrValue::Set {
61+
names.push("sap.parse_without_null");
62+
}
63+
if self.sap_pending_never == TyAttrValue::Set {
64+
names.push("sap.pending_never");
65+
}
66+
if self.sap_in_progress_never == TyAttrValue::Set {
67+
names.push("sap.in_progress_never");
68+
}
69+
names
70+
}
71+
}

0 commit comments

Comments
 (0)