MCPcopy Create free account
hub / github.com/PowerShell/DSC / parse_child_node

Method parse_child_node

resources/sshdconfig/src/parser.rs:70–83  ·  view source on GitHub ↗
(&mut self, node: tree_sitter::Node, input: &str, input_bytes: &[u8])

Source from the content-addressed store, hash-verified

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();

Callers 1

parse_textMethod · 0.80

Calls 1

parse_match_nodeMethod · 0.80

Tested by

no test coverage detected