parseWith method

Statement parseWith()

Implementation

Statement parseWith() {
  int? start = token!.startOffset;
  int? line = token!.line;
  assert(token!.text == 'with');
  consume(Token.NAME);
  consume(Token.LPAREN);
  Expression exp = parseExpression();
  consume(Token.RPAREN);
  Statement body = parseStatement();
  return WithStatement(exp, body)
    ..start = start
    ..end = endOffset
    ..line = line;
}