visitDeclare()

in lib/common_generator.js [306:325]


  visitDeclare(ast, level) {
    var id = _name(ast.id);
    this.emit(``, level);
    if (ast.expr.type === 'call' && ast.expr.isAsync) {
      this.emit(`CompletableFuture<`);
    }
    this.visitType(ast.expr.inferred);
    if (ast.expr.type === 'call' && ast.expr.isAsync) {
      this.emit(`> ${id}Future = `);
    } else {
      this.emit(` ${id} = `);
    }
    this.visitExpr(ast.expr, level);
    this.emit(';\n');
    if (ast.expr.type === 'call' && ast.expr.isAsync) {
      this.emit(``, level);
      this.visitType(ast.expr.inferred);
      this.emit(` ${id} = ${id}Future.join();\n`);
    }
  }