(&mut self, text: &str)
| 128 | let line = line.trim(); |
| 129 | if line.is_empty() { |
| 130 | if !block_lines.is_empty() { |
| 131 | self.parse_block(&block_lines)?; |
| 132 | block_lines.clear(); |
| 133 | } |
| 134 | } else { |
| 135 | block_lines.push((lineno + 1, line.to_string())); |
| 136 | } |
| 137 | } |
| 138 | |
| 139 | if !block_lines.is_empty() { |
| 140 | self.parse_block(&block_lines)?; |
| 141 | } |
| 142 | |
| 143 | Ok(self.script) |
| 144 | } |
| 145 | |
| 146 | fn parse_block(&mut self, lines: &[(usize, String)]) -> Result<(), EngineError> { |
| 147 | use Command::*; |
| 148 | use Commands::*; |
| 149 | |
| 150 | let mut block_commands = Vec::new(); |
| 151 | |
| 152 | for (index, (line_num, line)) in lines.iter().enumerate() { |
| 153 | if let Some(line) = line.strip_prefix('@') { |
| 154 | if let Some((cmd, arg)) = line.split_once(' ') { |
no test coverage detected