lib_ruby_parser_ast/nodes/types/
kwoptarg.rs1use crate::nodes::InnerNode;
4use crate::nodes::InspectVec;
5use crate::Loc;
6use crate::Node;
7
8#[derive(Debug, Clone, PartialEq)]
10#[repr(C)]
11pub struct Kwoptarg {
12 pub name: String,
14
15 pub default: Box<Node>,
17
18 pub name_l: Loc,
25
26 pub expression_l: Loc,
33
34}
35
36impl InnerNode for Kwoptarg {
37 fn expression(&self) -> &Loc {
38 &self.expression_l
39 }
40
41 fn inspected_children(&self, indent: usize) -> Vec<String> {
42 let mut result = InspectVec::new(indent);
43 result.push_str(&self.name);
44 result.push_node(&self.default);
45
46 result.strings()
47 }
48
49 fn str_type(&self) -> &'static str {
50 "kwoptarg"
51 }
52
53 fn print_with_locs(&self) {
54 println!("{}", self.inspect(0));
55 self.default.inner_ref().print_with_locs();
56 self.name_l.print("name");
57 self.expression_l.print("expression");
58
59 }
60}