MCPcopy Create free account
hub / github.com/PerroEngine/Perro / parse_frame_block

Method parse_frame_block

perro_source/core/perro_animation/src/panim/core.rs:191–229  ·  view source on GitHub ↗
(
        &mut self,
        start_line: usize,
        frame: u32,
        key_mode: AnimationKeyMode,
        object_types: &HashMap<String, NodeType>,
    )

Source from the content-addressed store, hash-verified

189 Err(format!(
190 "line {}: missing closing `[/Objects]` block",
191 start_line
192 ))
193 }
194
195 fn parse_frame_block(
196 &mut self,
197 start_line: usize,
198 frame: u32,
199 key_mode: AnimationKeyMode,
200 object_types: &HashMap<String, NodeType>,
201 ) -> Result<Vec<FrameAction>, String> {
202 let mut actions = Vec::new();
203
204 while let Some((line_no, line)) = self.next_line() {
205 let line = strip_comment(line).trim();
206 if line.is_empty() {
207 continue;
208 }
209 if is_frame_footer(line) {
210 return Ok(actions);
211 }
212
213 if line.starts_with('@') {
214 if line.ends_with('{') {
215 actions.extend(self.parse_object_block(
216 line_no,
217 frame,
218 key_mode,
219 line,
220 object_types,
221 )?);
222 continue;
223 }
224 if line.ends_with('}') {
225 actions.extend(self.parse_inline_object_block(
226 line_no,
227 frame,
228 key_mode,
229 line,
230 object_types,
231 )?);
232 continue;

Callers 1

parseMethod · 0.80

Calls 9

strip_commentFunction · 0.85
is_frame_footerFunction · 0.85
split_key_valueFunction · 0.85
parse_emit_signalFunction · 0.85
next_lineMethod · 0.80
extendMethod · 0.80
parse_object_blockMethod · 0.80
is_emptyMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected