frontend/examking-app/node_modules/prettier/parser-glimmer.js

(开头部分) 177KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

"use strict";

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };

function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }

function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _interopDefault(t) {
  return t && "object" == (typeof t === "undefined" ? "undefined" : _typeof(t)) && "default" in t ? t.default : t;
}var fs = _interopDefault(require("fs"));function createError(t, e) {
  var r = new SyntaxError(t + " (" + e.start.line + ":" + e.start.column + ")");return r.loc = e, r;
}var parserCreateError = createError;function isCall(t) {
  return "SubExpression" === t.type || "MustacheStatement" === t.type && "PathExpression" === t.path.type;
}function isLiteral(t) {
  return !("object" != (typeof t === "undefined" ? "undefined" : _typeof(t)) || !t.type.match(/Literal$/));
}var nodes = Object.freeze({ isCall: isCall, isLiteral: isLiteral });function buildMustache(t, e, r, a, i) {
  return isLiteral(t) || (t = buildPath(t)), { type: "MustacheStatement", path: t, params: e || [], hash: r || buildHash([]), escaped: !a, loc: buildLoc(i || null) };
}function buildBlock(t, e, r, a, i, n) {
  return { type: "BlockStatement", path: buildPath(t), params: e || [], hash: r || buildHash([]), program: a || null, inverse: i || null, loc: buildLoc(n || null) };
}function buildElementModifier(t, e, r, a) {
  return { type: "ElementModifierStatement", path: buildPath(t), params: e || [], hash: r || buildHash([]), loc: buildLoc(a || null) };
}function buildPartial(t, e, r, a, i) {
  return { type: "PartialStatement", name: t, params: e || [], hash: r || buildHash([]), indent: a || "", strip: { open: !1, close: !1 }, loc: buildLoc(i || null) };
}function buildComment(t, e) {
  return { type: "CommentStatement", value: t, loc: buildLoc(e || null) };
}function buildMustacheComment(t, e) {
  return { type: "MustacheCommentStatement", value: t, loc: buildLoc(e || null) };
}function buildConcat(t, e) {
  return { type: "ConcatStatement", parts: t || [], loc: buildLoc(e || null) };
}function buildElement(t, e, r, a, i, n) {
  return Array.isArray(i) || (n = i, i = []), { type: "ElementNode", tag: t || "", attributes: e || [], blockParams: [], modifiers: r || [], comments: i || [], children: a || [], loc: buildLoc(n || null) };
}function buildAttr(t, e, r) {
  return { type: "AttrNode", name: t, value: e, loc: buildLoc(r || null) };
}function buildText(t, e) {
  return { type: "TextNode", chars: t || "", loc: buildLoc(e || null) };
}function buildSexpr(t, e, r, a) {
  return { type: "SubExpression", path: buildPath(t), params: e || [], hash: r || buildHash([]), loc: buildLoc(a || null) };
}function buildPath(t, e) {
  if ("string" != typeof t) return t;var r = t.split("."),
      a = !1;return "this" === r[0] && (a = !0, r = r.slice(1)), { type: "PathExpression", original: t, this: a, parts: r, data: !1, loc: buildLoc(e || null) };
}function buildLiteral(t, e, r) {
  return { type: t, value: e, original: e, loc: buildLoc(r || null) };
}function buildHash(t, e) {
  return { type: "Hash", pairs: t || [], loc: buildLoc(e || null) };
}function buildPair(t, e, r) {
  return { type: "HashPair", key: t, value: e, loc: buildLoc(r || null) };
}function buildProgram(t, e, r) {
  return { type: "Program", body: t || [], blockParams: e || [], loc: buildLoc(r || null) };
}function buildSource(t) {
  return t || null;
}function buildPosition(t, e) {
  return { line: t, column: e };
}var SYNTHETIC = { source: "(synthetic)", start: { line: 1, column: 0 }, end: { line: 1, column: 0 } };function buildLoc() {
后面还有 1886 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。