parseWhile method

Statement parseWhile()

Implementation

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