`WHILE cond LOOP ... END LOOP;`
(tokens: &[Token], pos: &mut usize)
| 163 | |
| 164 | /// `WHILE cond LOOP ... END LOOP;` |
| 165 | fn parse_while(tokens: &[Token], pos: &mut usize) -> Result<Statement, ProceduralError> { |
| 166 | *pos += 1; |
| 167 | let condition = collect_sql_until(tokens, pos, &[Token::Loop])?; |
| 168 | expect_token(tokens, pos, &Token::Loop)?; |
| 169 | let body = super::parse_statements(tokens, pos)?; |
| 170 | expect_token(tokens, pos, &Token::EndLoop)?; |
| 171 | skip_if(tokens, pos, &Token::Semicolon); |
| 172 | Ok(Statement::While { condition, body }) |
| 173 | } |
| 174 | |
| 175 | /// `FOR var IN [REVERSE] start..end LOOP ... END LOOP;` |
| 176 | fn parse_for(tokens: &[Token], pos: &mut usize) -> Result<Statement, ProceduralError> { |
no test coverage detected