parseDoWhile method

Statement parseDoWhile()

Implementation

Statement parseDoWhile() {
  int start = token?.startOffset??0;
  int line = token?.line??0;
  assert(token?.text == 'do');
  consume(Token.NAME);
  Statement body = parseStatement();
  consumeName('while');
  consume(Token.LPAREN);
  Expression condition = parseExpression();
  consume(Token.RPAREN);
  consumeSemicolon();
  return new DoWhileStatement(body, condition)
    ..start = start
    ..end = endOffset
    ..line = line;
}