How to use the lua-types.isChunk function in lua-types

To help you get started, we’ve selected a few lua-types examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ark120202 / babel-lua / packages / lua-generator / src / printer.js View on Github external
node && node.constructor.name,
        )}`,
      );
    }

    this._printStack.push(node);

    const needsParens = n.needsParens(node, parent, this._printStack);
    if (needsParens) {
      if (this._endsWithCall) this.semicolon(true);
      this.token('(');
    }

    // this._printLeadingComments(node, parent);

    const loc = t.isChunk(node) ? null : node.loc;
    this.withSource('start', loc, () => {
      this[node.type](node, parent);
    });

    // this._printTrailingComments(node, parent);

    if (needsParens) this.token(')');

    // end
    this._printStack.pop();
    this._endsWithCall =
      node.type === 'CallStatement' ||
      (node.type === 'LocalStatement' &&
        node.init.length > 0 &&
        node.init[node.init.length - 1].type === 'CallExpression');