natter/src/intermediate/src_block.rs

18 lines
373 B
Rust
Raw Normal View History

use super::macros::intermediate;
2023-10-30 02:31:29 +00:00
use crate::error::CustomError;
2023-10-27 21:08:58 +00:00
2023-10-29 19:36:15 +00:00
#[derive(Debug, Clone)]
pub(crate) struct ISrcBlock {
pub(crate) lines: Vec<String>,
}
2023-10-27 21:08:58 +00:00
2023-10-30 02:31:29 +00:00
intermediate!(ISrcBlock, SrcBlock, original, _registry, {
let lines = original
.contents
.split_inclusive('\n')
.map(|s| s.to_owned())
.collect();
Ok(ISrcBlock { lines })
});