Skip to content

Commit

Permalink
minor progress in resolving arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
amitu committed Dec 2, 2024
1 parent c5d13c8 commit 107d2f9
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
2 changes: 1 addition & 1 deletion v0.5/fastn-unresolved/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ pub struct ComponentInvocation {
#[derive(Debug, Clone, PartialEq)]
pub struct Property {
pub name: fastn_section::Identifier,
pub value: Vec<fastn_section::Tes>,
pub value: fastn_section::HeaderValue,
}

#[derive(Debug, Clone, PartialEq)]
Expand Down
22 changes: 20 additions & 2 deletions v0.5/fastn-unresolved/src/resolver/arguments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ fn caption_or_body(
return;
}

let _argument = if let fastn_unresolved::UR::UnResolved(Some(_v)) = v {
let (argument, inner_v) = if let fastn_unresolved::UR::UnResolved(Some(inner_v)) = v {
// see if any of the arguments are of type caption or body
// assume there is only one such argument, because otherwise arguments would have failed
// to resolve
Expand All @@ -40,7 +40,7 @@ fn caption_or_body(
v.is_body()
}
}) {
Some(v) => v,
Some(a) => (a, inner_v),
None => {
*v = fastn_unresolved::UR::Invalid(fastn_section::Error::UnexpectedCaption);
return;
Expand All @@ -49,4 +49,22 @@ fn caption_or_body(
} else {
return;
};

match crate::resolver::arguments::argument(argument, inner_v) {
Ok(Some(_p)) => {
todo!()
// *v = fastn_unresolved::UR::Resolved(p)
}
Ok(None) => {
todo!()
}
Err(e) => *v = fastn_unresolved::UR::Invalid(e),
}
}

fn argument(
_argument: &fastn_resolved::Argument,
_value: &fastn_section::HeaderValue,
) -> Result<Option<fastn_resolved::Property>, fastn_section::Error> {
todo!()
}

0 comments on commit 107d2f9

Please sign in to comment.