Sha256: 246897e1d4c182b20a2d14f3ceec97b68d02eb588da0c9d921dff5f2dc319321

Contents?: true

Size: 792 Bytes

Versions: 3

Compression:

Stored size: 792 Bytes

Contents

use :node;

var Node = module.require('../Node').Node;

fn GoStatement(body)
  extends Node {
  
  this.type = 'GoStatement';
  
  this.body = body;
  this.body.parent = this;
}

GoStatement.prototype.codegen = () -> {
  if !super.codegen() {
    return;
  }
    
  this.body = this.body.codegen();
  
  this.type = "ExpressionStatement";
  this.expression = {
    "type": "CallExpression",
    "callee": {
      "type": "UnaryExpression",
      "operator": "async",
      "argument": {
        "type": "FunctionExpression",
        "id": null,
        "params": [],
        "defaults": [],
        "body": this.body,
        "rest": null,
        "generator": false,
        "expression": false
      }
    },
    "arguments": []
  };
  
  return this;
};

exports.GoStatement = GoStatement;

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
spider-src-0.1.7 lib/spider-src/support/spider/src/ast/statements/GoStatement.spider
spider-src-0.1.6 lib/spider-src/support/spider/src/ast/statements/GoStatement.spider
spider-src-0.1.5 lib/spider-src/support/spider/src/ast/statements/GoStatement.spider