(&mut self, node: tree_sitter::Node, input: &str, input_bytes: &[u8])
| 68 | } |
| 69 | |
| 70 | fn parse_child_node(&mut self, node: tree_sitter::Node, input: &str, input_bytes: &[u8]) -> Result<(), SshdConfigError> { |
| 71 | if node.is_error() { |
| 72 | return Err(SshdConfigError::ParserError(t!("parser.failedToParse", input = input).to_string())); |
| 73 | } |
| 74 | match node.kind() { |
| 75 | "comment" => Ok(()), |
| 76 | "keyword" => { |
| 77 | Self::parse_and_insert_keyword(node, input, input_bytes, Some(&mut self.map))?; |
| 78 | Ok(()) |
| 79 | } |
| 80 | "match" => self.parse_match_node(node, input, input_bytes), |
| 81 | _ => Err(SshdConfigError::ParserError(t!("parser.unknownNodeType", node = node.kind()).to_string())), |
| 82 | } |
| 83 | } |
| 84 | |
| 85 | fn parse_match_node(&mut self, match_node: tree_sitter::Node, input: &str, input_bytes: &[u8]) -> Result<(), SshdConfigError> { |
| 86 | let mut criteria_map = Map::new(); |
no test coverage detected