| 1607 | } |
| 1608 | |
| 1609 | bool ParseDoWhileExpr(Lexeme** str) |
| 1610 | { |
| 1611 | if(!ParseLexem(str, lex_do)) |
| 1612 | return false; |
| 1613 | |
| 1614 | IncreaseCycleDepth(); |
| 1615 | |
| 1616 | if(!ParseExpression(str)) |
| 1617 | ThrowError((*str)->pos, "ERROR: expression expected after 'do'"); |
| 1618 | |
| 1619 | if(!ParseLexem(str, lex_while)) |
| 1620 | ThrowError((*str)->pos, "ERROR: 'while' expected after 'do' statement"); |
| 1621 | if(!ParseLexem(str, lex_oparen)) |
| 1622 | ThrowError((*str)->pos, "ERROR: '(' not found after 'while'"); |
| 1623 | |
| 1624 | const char *condPos = (*str)->pos; |
| 1625 | if(!ParseVaribleSet(str)) |
| 1626 | ThrowError((*str)->pos, "ERROR: expression expected after 'while('"); |
| 1627 | if(!ParseLexem(str, lex_cparen)) |
| 1628 | ThrowError((*str)->pos, "ERROR: closing ')' not found after expression in 'while' statement"); |
| 1629 | |
| 1630 | AddDoWhileNode(condPos); |
| 1631 | |
| 1632 | if(!ParseLexem(str, lex_semicolon)) |
| 1633 | ThrowError((*str)->pos, "ERROR: while(...) should be followed by ';'"); |
| 1634 | return true; |
| 1635 | } |
| 1636 | |
| 1637 | bool ParseSwitchExpr(Lexeme** str) |
| 1638 | { |
no test coverage detected