returnStatement method

Stmt returnStatement()

Implementation

Stmt returnStatement() {
  Token keyword = previous();
  Expr? value;
  if (!check(TokenType.SEMICOLON)) {
    value = expression();
  }
  consume(TokenType.SEMICOLON, "Expect ';' after return value.");
  return Return(keyword, value);
}