| 1 | use crate::block::BlockContext; |
| 2 | use crate::json::value::PathAndJson; |
| 3 | |
| 4 | pub(crate) fn create_block<'rc>(param: &PathAndJson<'rc>) -> BlockContext<'rc> { |
| 5 | let mut block = BlockContext::new(); |
| 6 | |
| 7 | if let Some(new_path) = param.context_path() { |
| 8 | block.base_path_mut().clone_from(new_path) |
| 9 | } else { |
| 10 | // use clone for now |
| 11 | block.set_base_value(param.value().clone()); |
| 12 | } |
| 13 | |
| 14 | block |
| 15 | } |