Skip to content

Commit

Permalink
feat(oca-bundle): add support for flagged attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
mitfik committed Jan 11, 2024
1 parent 01f1fdc commit f19ba4d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion oca-bundle/src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ pub fn from_ast(
}
}
Err(mut err) => {
println!("Error applying command: {:?}", err);
errors.extend(err.iter_mut().map(|e| Error::FromASTError {
line_number: command_meta.line_number,
raw_line: command_meta.raw_line.clone(),
Expand Down Expand Up @@ -515,6 +514,7 @@ mod tests {
object_kind: ast::ObjectKind::CaptureBase(CaptureContent {
attributes: Some(attributes),
properties: None,
flagged_attributes: None,
}),
});

Expand Down Expand Up @@ -676,11 +676,14 @@ mod tests {
"passed".to_string(),
ast::NestedAttrType::Value(AttributeType::Boolean),
);

let flagged_attributes = vec!["d".to_string(), "i".to_string()];
commands.push(ast::Command {
kind: ast::CommandType::Add,
object_kind: ast::ObjectKind::CaptureBase(ast::CaptureContent {
attributes: Some(attributes),
properties: None,
flagged_attributes: Some(flagged_attributes.clone()),
}),
});

Expand Down
1 change: 1 addition & 0 deletions oca-bundle/src/state/oca.rs
Original file line number Diff line number Diff line change
Expand Up @@ -891,6 +891,7 @@ impl OCABundle {
// TODO find out if we can use indexmap in capture base to simplify stuff
attributes: Some(self.capture_base.attributes.clone().into_iter().collect()),
properties,
flagged_attributes: None,
}),
};
ast.commands.push(command);
Expand Down

0 comments on commit f19ba4d

Please sign in to comment.