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