pub(in crate::syntax::ast::node) fn to_indented_string(
        &self,
        interner: &Interner,
        indent: usize,
    ) -> String {
        let mut buf = "{\n".to_owned();
        let indentation = "    ".repeat(indent + 1);
        for property in self.properties().iter() {
            buf.push_str(&match property {
                PropertyDefinition::IdentifierReference(key) => {
                    format!("{}{},\n", indentation, key)
                }
                PropertyDefinition::Property(key, value) => {
                    format!(
                        "{}{}: {},\n",
                        indentation,
                        key.to_interned_string(interner),
                        value.to_no_indent_string(interner, indent + 1)
                    )
                }
                PropertyDefinition::SpreadObject(key) => {
                    format!("{}...{},\n", indentation, key.to_interned_string(interner))
                }
                PropertyDefinition::MethodDefinition(kind, key, node) => {
                    format!(
                        "{}{}{}({}) {},\n",
                        indentation,
                        match &kind {
                            MethodDefinitionKind::Get => "get ",
                            MethodDefinitionKind::Set => "set ",
                            MethodDefinitionKind::Ordinary
                            | MethodDefinitionKind::Generator
                            | MethodDefinitionKind::Async
                            | MethodDefinitionKind::AsyncGenerator => "",
                        },
                        key.to_interned_string(interner),
                        join_nodes(interner, node.parameters()),
                        block_to_string(node.body(), interner, indent + 1)
                    )
                }
            });
        }
        buf.push_str(&format!("{}}}", "    ".repeat(indent)));

        buf
    }
/// Implements the display formatting with indentation.
Implements the display formatting with indentation.
Implements the display formatting with indentation .
pub(in crate::syntax::ast::node) fn to_indented_string(
        &self,
        interner: &Interner,
        indent: usize,
    ) -> String {
        let mut buf = "{\n".to_owned();
        let indentation = "    ".repeat(indent + 1);
        for property in self.properties().iter() {
            buf.push_str(&match property {
                PropertyDefinition::IdentifierReference(key) => {
                    format!("{}{},\n", indentation, key)
                }
                PropertyDefinition::Property(key, value) => {
                    format!(
                        "{}{}: {},\n",
                        indentation,
                        key.to_interned_string(interner),
                        value.to_no_indent_string(interner, indent + 1)
                    )
                }
                PropertyDefinition::SpreadObject(key) => {
                    format!("{}...{},\n", indentation, key.to_interned_string(interner))
                }
                PropertyDefinition::MethodDefinition(kind, key, node) => {
                    format!(
                        "{}{}{}({}) {},\n",
                        indentation,
                        match &kind {
                            MethodDefinitionKind::Get => "get ",
                            MethodDefinitionKind::Set => "set ",
                            MethodDefinitionKind::Ordinary
                            | MethodDefinitionKind::Generator
                            | MethodDefinitionKind::Async
                            | MethodDefinitionKind::AsyncGenerator => "",
                        },
                        key.to_interned_string(interner),
                        join_nodes(interner, node.parameters()),
                        block_to_string(node.body(), interner, indent + 1)
                    )
                }
            });
        }
        buf.push_str(&format!("{}}}", "    ".repeat(indent)));
        buf
    }
pub ( in crate :: syntax :: ast :: node ) fn to_indented_string ( & self , interner : & Interner , indent : usize , ) -> String { let mut buf = " \n " . to_owned ( ) ; let indentation = " " . repeat ( indent + 1 ) ; for property in self . properties ( ) . iter ( ) { buf . push_str ( & match property { PropertyDefinition :: IdentifierReference ( key ) => { format ! ( " \n " indentation key ) } PropertyDefinition :: Property ( key , value ) => { format ! ( " \n " indentation key to_interned_string ( interner ) value to_no_indent_string ( interner indent 1 ) ) } PropertyDefinition :: SpreadObject ( key ) => { format ! ( " \n " indentation key to_interned_string ( interner ) ) } PropertyDefinition :: MethodDefinition ( kind , key , node ) => { format ! ( " \n " indentation match kind { MethodDefinitionKind Get " " MethodDefinitionKind Set " " MethodDefinitionKind Ordinary MethodDefinitionKind Generator MethodDefinitionKind Async MethodDefinitionKind AsyncGenerator " " } key to_interned_string ( interner ) join_nodes ( interner node parameters ( ) ) block_to_string ( node body ( ) interner indent 1 ) ) } } ) ; } buf . push_str ( & format ! ( " " " " repeat ( indent ) ) ) ; buf }
Implements the display formatting with indentation.
Implements the display formatting with indentation .
&self
interner
&Interner
indent
usize
&self
interner
&Interner
indent
usize