teo_parser/ast/
synthesized_shape_field_declaration.rs1use std::cell::RefCell;
2use crate::{declare_container_node, impl_container_node_defaults, node_child_fn, node_optional_child_fn};
3use crate::ast::doc_comment::DocComment;
4use crate::ast::identifier_path::IdentifierPath;
5use crate::format::Writer;
6use crate::traits::resolved::Resolve;
7use crate::traits::write::Write;
8
9declare_container_node!(SynthesizedShapeFieldDeclaration, availability,
10 pub(crate) comment: Option<usize>,
11 pub(crate) decorator_identifier_path: usize,
12 pub(crate) optional: bool,
13 pub(crate) resolved: RefCell<Option<SynthesizedShapeFieldDeclarationResolved>>,
14);
15
16impl_container_node_defaults!(SynthesizedShapeFieldDeclaration, availability);
17
18impl SynthesizedShapeFieldDeclaration {
19
20 node_optional_child_fn!(comment, DocComment);
21
22 node_child_fn!(decorator_identifier_path, IdentifierPath);
23}
24
25impl Write for SynthesizedShapeFieldDeclaration {
26 fn write<'a>(&'a self, writer: &mut Writer<'a>) {
27 writer.write_children(self, self.children.values());
28 }
29}
30
31impl Resolve<SynthesizedShapeFieldDeclarationResolved> for SynthesizedShapeFieldDeclaration {
32 fn resolved_ref_cell(&self) -> &RefCell<Option<SynthesizedShapeFieldDeclarationResolved>> {
33 &self.resolved
34 }
35}
36
37#[derive(Debug)]
38pub struct SynthesizedShapeFieldDeclarationResolved {
39 pub decorator_full_path: Option<Vec<String>>,
40}