Skip to content

Commit

Permalink
header_value_ender
Browse files Browse the repository at this point in the history
  • Loading branch information
amitu committed Oct 30, 2024
1 parent dc65457 commit 65e2320
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
4 changes: 2 additions & 2 deletions v0.5/fastn-p1/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,9 @@ pub enum SES {
Expression {
start: usize,
end: usize,
content: Vec<SES>,
content: HeaderValue,
},
Section(Box<Section>),
Section(Vec<Section>),
}

#[derive(Default)]
Expand Down
23 changes: 19 additions & 4 deletions v0.5/fastn-p1/src/wiggin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,26 @@ fn section_ender(
}

fn header_value_ender(
_source: &str,
_o: &mut fastn_p1::ParseOutput,
_header: fastn_p1::HeaderValue,
source: &str,
o: &mut fastn_p1::ParseOutput,
header: fastn_p1::HeaderValue,
) -> fastn_p1::HeaderValue {
todo!()
header
.into_iter()
.map(|ses| match ses {
fastn_p1::SES::String(span) => fastn_p1::SES::String(span),
fastn_p1::SES::Expression {
start,
end,
content,
} => fastn_p1::SES::Expression {
start,
end,
content: header_value_ender(source, o, content),
},
fastn_p1::SES::Section(sections) => fastn_p1::SES::Section(ender(source, o, sections)),
})
.collect()
}

/// converts a section list, with interleaved `-- end: <section-name>`, into a nested section list
Expand Down

0 comments on commit 65e2320

Please sign in to comment.