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

Method collect_lines

src/extraction/gwbasic_extractor.rs:157–174  ·  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

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