Get the source code lines.

This commit is contained in:
Tom Alexander
2023-10-29 10:32:05 -04:00
parent 313313ae53
commit fb99fd2b39
2 changed files with 133 additions and 4 deletions

View File

@@ -1,6 +1,7 @@
use crate::error::CustomError;
use super::registry::Registry;
use super::util::GetFullLines;
#[derive(Debug)]
pub(crate) struct ISrcBlock {
@@ -12,9 +13,11 @@ impl ISrcBlock {
registry: &mut Registry<'parse>,
original: &organic::types::SrcBlock<'parse>,
) -> Result<ISrcBlock, CustomError> {
// let contents = original.contents.
Ok(ISrcBlock {
lines: Vec::new(), // TODO
})
let lines = original
.contents
.full_lines()
.map(|s| s.to_owned())
.collect();
Ok(ISrcBlock { lines })
}
}