MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / collect_lines

Method collect_lines

src/extraction/msbasic2_extractor.rs:155–172  ·  view source on GitHub ↗

Collect all lines from the program into a structured list.

(state: &ExtractionState, root: TsNode<'a>)

Source from the content-addressed store, hash-verified

153
154 /// Collect all lines from the program into a structured list.
155 fn collect_lines<'a>(state: &ExtractionState, root: TsNode<'a>) -> Vec<BasicLine<'a>> {
156 let mut lines = Vec::new();
157 let mut cursor = root.walk();
158 if cursor.goto_first_child() {
159 loop {
160 let node = cursor.node();
161 if node.kind() == "line" {
162 if let Some(basic_line) = Self::parse_line(state, node) {
163 lines.push(basic_line);
164 }
165 }
166 if !cursor.goto_next_sibling() {
167 break;
168 }
169 }
170 }
171 lines
172 }
173
174 /// Parse a single `line` node into a `BasicLine` struct.
175 fn parse_line<'a>(state: &ExtractionState, node: TsNode<'a>) -> Option<BasicLine<'a>> {

Callers

nothing calls this directly

Calls 3

parse_lineFunction · 0.85
kindMethod · 0.80
pushMethod · 0.80

Tested by

no test coverage detected