source: trip-planner-front/node_modules/@babel/core/lib/parse.js

Last change on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 1.1 KB
Line 
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.parseAsync = exports.parseSync = exports.parse = void 0;
7
8function _gensync() {
9 const data = require("gensync");
10
11 _gensync = function () {
12 return data;
13 };
14
15 return data;
16}
17
18var _config = require("./config");
19
20var _parser = require("./parser");
21
22var _normalizeOpts = require("./transformation/normalize-opts");
23
24const parseRunner = _gensync()(function* parse(code, opts) {
25 const config = yield* (0, _config.default)(opts);
26
27 if (config === null) {
28 return null;
29 }
30
31 return yield* (0, _parser.default)(config.passes, (0, _normalizeOpts.default)(config), code);
32});
33
34const parse = function parse(code, opts, callback) {
35 if (typeof opts === "function") {
36 callback = opts;
37 opts = undefined;
38 }
39
40 if (callback === undefined) return parseRunner.sync(code, opts);
41 parseRunner.errback(code, opts, callback);
42};
43
44exports.parse = parse;
45const parseSync = parseRunner.sync;
46exports.parseSync = parseSync;
47const parseAsync = parseRunner.async;
48exports.parseAsync = parseAsync;
Note: See TracBrowser for help on using the repository browser.