lib_ruby_parser_ast/nodes/
node.rs

1use crate::Loc;
2use crate::Node;
3
4impl Node {
5    /// Returns a whitequark/parser -like representation of `self`.
6    ///
7    /// Used in tests and example scripts
8    pub fn inspect(&self, indent: usize) -> String {
9        self.inner_ref().inspect(indent)
10    }
11
12    /// Returns location of the full node expression
13    pub fn expression(&self) -> &Loc {
14        self.inner_ref().expression()
15    }
16
17    /// Returns a whitequark/parser -like node name.
18    ///
19    /// Used in tests and example scripts
20    pub fn str_type(&self) -> &'static str {
21        self.inner_ref().str_type()
22    }
23
24    /// Prints itself + location information
25    pub fn print_with_locs(&self) {
26        self.inner_ref().print_with_locs()
27    }
28}