How to use the babylon/lib/tokenizer/types.types.parenL function in babylon

To help you get started, we’ve selected a few babylon 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 forivall / tacoscript / packages / babylon-plugin-cst / src / plugin.js View on Github external
let meta = this.parseIdent(true);

      if (this.eat(tt.dot)) {
        node.meta = meta;
        node.property = this.parseIdent(true);

        if (node.property.name !== "target") {
          this.raise(node.property.start, "The only valid meta property for new is new.target");
        }

        return this.finishNode(node, "MetaProperty");
      }

      node.callee = this.parseNoCallExpr();

      if (this.eat(tt.parenL)) {
        node.arguments = this.parseExprList(tt.parenR, this.options.features["es7.trailingFunctionCommas"]);
        this.toReferencedList(node.arguments);
      } else {
        node.emptyArguments = true;
        node.arguments = [];
      }

      return this.finishNode(node, "NewExpression");
    };
  });
github nikaspran / coffee-to-ts / src / babel / import.js View on Github external
Parser.prototype.tsParseImportRequire = function (node) {
	this.next();
	node.local = this.parseIdentifier();

	this.eat(types.eq);
	this.eatContextual('require');
	this.eat(types.parenL);

	node.source = this.match(types.string) ? this.parseExprAtom() : this.unexpected();
	this.eat(types.parenR);
	this.semicolon();
	return this.finishNode(node, 'ImportRequire');
};