Initial structure for dynamic blocks.
This commit is contained in:
22
src/parser/dynamic_block.rs
Normal file
22
src/parser/dynamic_block.rs
Normal file
@@ -0,0 +1,22 @@
|
||||
use super::error::Res;
|
||||
use super::Context;
|
||||
use crate::parser::error::CustomError;
|
||||
use crate::parser::error::MyError;
|
||||
use crate::parser::greater_element::DynamicBlock;
|
||||
use crate::parser::util::immediate_in_section;
|
||||
use crate::parser::util::start_of_line;
|
||||
|
||||
#[tracing::instrument(ret, level = "debug")]
|
||||
pub fn dynamic_block<'r, 's>(
|
||||
context: Context<'r, 's>,
|
||||
input: &'s str,
|
||||
) -> Res<&'s str, DynamicBlock<'s>> {
|
||||
// TODO: Do I need to differentiate between different dynamic block types.
|
||||
if immediate_in_section(context, "dynamic block") {
|
||||
return Err(nom::Err::Error(CustomError::MyError(MyError(
|
||||
"Cannot nest objects of the same element",
|
||||
))));
|
||||
}
|
||||
start_of_line(context, input)?;
|
||||
todo!()
|
||||
}
|
||||
Reference in New Issue
Block a user