(&mut self, container: &CstContainerNode, ast_value: ast::Value<'_>)
| 2419 | } |
| 2420 | |
| 2421 | fn build_value(&mut self, container: &CstContainerNode, ast_value: ast::Value<'_>) { |
| 2422 | match ast_value { |
| 2423 | ast::Value::StringLit(string_lit) => self.build_string_lit(container, string_lit), |
| 2424 | ast::Value::NumberLit(number_lit) => { |
| 2425 | container.raw_append_child(CstNumberLit::new(number_lit.value.to_string()).into()) |
| 2426 | } |
| 2427 | ast::Value::BooleanLit(boolean_lit) => container.raw_append_child(CstBooleanLit::new(boolean_lit.value).into()), |
| 2428 | ast::Value::Object(object) => { |
| 2429 | let object = self.build_object(object); |
| 2430 | container.raw_append_child(object.into()) |
| 2431 | } |
| 2432 | ast::Value::Array(array) => { |
| 2433 | let array = self.build_array(array); |
| 2434 | container.raw_append_child(array.into()) |
| 2435 | } |
| 2436 | ast::Value::NullKeyword(_) => container.raw_append_child(CstNullKeyword::new().into()), |
| 2437 | } |
| 2438 | } |
| 2439 | |
| 2440 | fn build_object(&mut self, object: ast::Object<'_>) -> CstContainerNode { |
| 2441 | let container = CstContainerNode::Object(CstObject::new_no_tokens()); |
no test coverage detected