(
state: &mut ParserState<'heap, '_, '_>,
key: &Key<'_>,
)
| 35 | |
| 36 | impl<'heap> DictNode<'heap> { |
| 37 | pub(crate) fn parse( |
| 38 | state: &mut ParserState<'heap, '_, '_>, |
| 39 | key: &Key<'_>, |
| 40 | ) -> Result<Self, ParserDiagnostic> { |
| 41 | let expr = parse_dict(state)?; |
| 42 | |
| 43 | Ok(Self { |
| 44 | key_span: key.span, |
| 45 | expr, |
| 46 | r#type: None, |
| 47 | }) |
| 48 | } |
| 49 | |
| 50 | pub(crate) fn with_type(mut self, r#type: TypeNode<'heap>) -> Self { |
| 51 | self.r#type = Some(r#type); |