UNPKG

siphon-cli

Version:

Simple bundler for web applications. 📦🔧🧡

45 lines (44 loc) • 1.93 kB
"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); exports.ezra = exports.ezra_parse_internals = void 0; var types_1 = require("../../../../types"); var utils_1 = require("./utils"); var ezra_parse_internals = (function (_super) { __extends(ezra_parse_internals, _super); function ezra_parse_internals() { return _super !== null && _super.apply(this, arguments) || this; } return ezra_parse_internals; }(utils_1.parse_utils)); exports.ezra_parse_internals = ezra_parse_internals; exports.ezra = ezra_parse_internals.prototype; exports.ezra.parse = function (input, options, from) { var _a; if (from === void 0) { from = 0; } this.scope = new types_1.Program(0); this.text = input; this.next(0); this.contexts.push("global"); this.options = options; this.i = this.from = from; while (!(this.text[this.i] === undefined)) this.scope.push(this.statement()); this.scope.loc.end = this.text.length; this.scope.sourceType = (_a = this.options.sourceType) !== null && _a !== void 0 ? _a : "module"; return this.scope; };