2023-10-29 21:29:16 +00:00
|
|
|
use super::macros::intermediate;
|
2023-10-30 02:31:29 +00:00
|
|
|
|
2023-10-29 21:29:16 +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)]
|
2023-10-29 13:37:27 +00:00
|
|
|
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, {
|
2023-10-29 21:29:16 +00:00
|
|
|
let lines = original
|
|
|
|
.contents
|
|
|
|
.split_inclusive('\n')
|
|
|
|
.map(|s| s.to_owned())
|
|
|
|
.collect();
|
|
|
|
Ok(ISrcBlock { lines })
|
|
|
|
});
|