parseReturn method

Statement parseReturn()

Implementation

Statement parseReturn() {
  int start = token?.startOffset??0;
  int line = token?.line??0;
  assert(token?.text == 'return');
  consume(Token.NAME);
  Expression? exp;
  if (token?.type != Token.SEMICOLON &&
      token?.type != Token.RBRACE &&
      token?.type != Token.EOF &&
      !(null!=token && token!.afterLinebreak)) {
    exp = parseExpression();
  }
  consumeSemicolon();
  return new ReturnStatement(exp)
    ..start = start
    ..end = endOffset
    ..line = line;
}