visitInstanceCall()

in lib/generator.js [1749:1771]


  visitInstanceCall(ast, level) {
    assert.equal(ast.left.type, 'instance_call');
    const method = _name(ast.left.propertyPath[0]);
    const async = ast.isAsync && this.isAsyncFunction;
    if (async) {
      this.emit('await ');
    }
    if (ast.builtinModule && this.builtin[ast.builtinModule] && this.builtin[ast.builtinModule][method]) {
      this.builtin[ast.builtinModule][method](ast, level, async);
    } else {
      if (ast.left.id.tag === DSL.Tag.Tag.VID) {
        this.emit(`self.${_snakeCase(_vid(ast.left.id))}`);
      } else {
        const aliasId = _snakeCase(_name(ast.left.id));
        this.emit(aliasId);
      }
      this.emit(`.${(_avoidKeywords(_snakeCase(method)))}`);
      if(async) {
        this.emit('_async');
      }
      this.visitArgs(ast.args, level);
    }
  }