Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

parser.js 42KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448
  1. 'use strict';
  2. exports.__esModule = true;
  3. var _declaration = require('postcss/lib/declaration');
  4. var _declaration2 = _interopRequireDefault(_declaration);
  5. var _comment = require('postcss/lib/comment');
  6. var _comment2 = _interopRequireDefault(_comment);
  7. var _atRule = require('postcss/lib/at-rule');
  8. var _atRule2 = _interopRequireDefault(_atRule);
  9. var _rule = require('postcss/lib/rule');
  10. var _rule2 = _interopRequireDefault(_rule);
  11. var _root = require('postcss/lib/root');
  12. var _root2 = _interopRequireDefault(_root);
  13. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  14. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15. var Parser = function () {
  16. function Parser(input) {
  17. _classCallCheck(this, Parser);
  18. this.input = input;
  19. this.pos = 0;
  20. this.root = new _root2.default();
  21. this.current = this.root;
  22. this.spaces = '';
  23. this.extraIndent = false;
  24. this.prevIndent = undefined;
  25. this.step = undefined;
  26. this.root.source = { input: input, start: { line: 1, column: 1 } };
  27. }
  28. Parser.prototype.loop = function loop() {
  29. var part = void 0;
  30. while (this.pos < this.parts.length) {
  31. part = this.parts[this.pos];
  32. if (part.comment) {
  33. this.comment(part);
  34. } else if (part.atrule) {
  35. this.atrule(part);
  36. } else if (part.colon) {
  37. var next = this.nextNonComment(this.pos);
  38. if (next.end || next.atrule) {
  39. this.decl(part);
  40. } else {
  41. var moreIndent = next.indent.length > part.indent.length;
  42. if (!moreIndent) {
  43. this.decl(part);
  44. } else if (moreIndent && next.colon) {
  45. this.rule(part);
  46. } else if (moreIndent && !next.colon) {
  47. this.decl(part);
  48. }
  49. }
  50. } else if (part.end) {
  51. this.root.raws.after = part.before;
  52. } else {
  53. this.rule(part);
  54. }
  55. this.pos += 1;
  56. }
  57. for (var i = this.tokens.length - 1; i >= 0; i--) {
  58. if (this.tokens[i].length > 3) {
  59. var last = this.tokens[i];
  60. this.root.source.end = {
  61. line: last[4] || last[2],
  62. column: last[5] || last[3]
  63. };
  64. break;
  65. }
  66. }
  67. };
  68. Parser.prototype.comment = function comment(part) {
  69. var token = part.tokens[0];
  70. var node = new _comment2.default();
  71. this.init(node, part);
  72. node.source.end = { line: token[4], column: token[5] };
  73. this.commentText(node, token);
  74. };
  75. Parser.prototype.atrule = function atrule(part) {
  76. var atword = part.tokens[0];
  77. var params = part.tokens.slice(1);
  78. var node = new _atRule2.default();
  79. node.name = atword[1].slice(1);
  80. this.init(node, part);
  81. if (node.name === '') this.unnamedAtrule(atword);
  82. while (!part.end && part.lastComma) {
  83. this.pos += 1;
  84. part = this.parts[this.pos];
  85. params.push(['space', part.before + part.indent]);
  86. params = params.concat(part.tokens);
  87. }
  88. node.raws.afterName = this.firstSpaces(params);
  89. this.keepTrailingSpace(node, params);
  90. this.checkSemicolon(params);
  91. this.checkCurly(params);
  92. this.raw(node, 'params', params, atword);
  93. };
  94. Parser.prototype.decl = function decl(part) {
  95. var node = new _declaration2.default();
  96. this.init(node, part);
  97. var between = '';
  98. var colon = 0;
  99. var value = [];
  100. var prop = '';
  101. for (var i = 0; i < part.tokens.length; i++) {
  102. var token = part.tokens[i];
  103. if (token[0] === ':') {
  104. between += token[1];
  105. colon = token;
  106. value = part.tokens.slice(i + 1);
  107. break;
  108. } else if (token[0] === 'comment' || token[0] === 'space') {
  109. between += token[1];
  110. } else if (between !== '') {
  111. this.badProp(token);
  112. } else {
  113. prop += token[1];
  114. }
  115. }
  116. if (prop === '') this.unnamedDecl(part.tokens[0]);
  117. node.prop = prop;
  118. var next = this.parts[this.pos + 1];
  119. while (!next.end && !next.atrule && !next.colon && next.indent.length > part.indent.length) {
  120. value.push(['space', next.before + next.indent]);
  121. value = value.concat(next.tokens);
  122. this.pos += 1;
  123. next = this.parts[this.pos + 1];
  124. }
  125. var last = value[value.length - 1];
  126. if (last && last[0] === 'comment') {
  127. value.pop();
  128. var comment = new _comment2.default();
  129. this.current.push(comment);
  130. comment.source = {
  131. input: this.input,
  132. start: { line: last[2], column: last[3] },
  133. end: { line: last[4], column: last[5] }
  134. };
  135. var prev = value[value.length - 1];
  136. if (prev && prev[0] === 'space') {
  137. value.pop();
  138. comment.raws.before = prev[1];
  139. }
  140. this.commentText(comment, last);
  141. }
  142. for (var _i = value.length - 1; _i > 0; _i--) {
  143. var t = value[_i][0];
  144. if (t === 'word' && value[_i][1] === '!important') {
  145. node.important = true;
  146. if (_i > 0 && value[_i - 1][0] === 'space') {
  147. node.raws.important = value[_i - 1][1] + '!important';
  148. value.splice(_i - 1, 2);
  149. } else {
  150. node.raws.important = '!important';
  151. value.splice(_i, 1);
  152. }
  153. break;
  154. } else if (t !== 'space' && t !== 'newline' && t !== 'comment') {
  155. break;
  156. }
  157. }
  158. node.raws.between = between + this.firstSpaces(value);
  159. this.checkSemicolon(value);
  160. this.raw(node, 'value', value, colon);
  161. };
  162. Parser.prototype.rule = function rule(part) {
  163. var node = new _rule2.default();
  164. this.init(node, part);
  165. var selector = part.tokens;
  166. var next = this.parts[this.pos + 1];
  167. while (!next.end && next.indent.length === part.indent.length) {
  168. selector.push(['space', next.before + next.indent]);
  169. selector = selector.concat(next.tokens);
  170. this.pos += 1;
  171. next = this.parts[this.pos + 1];
  172. }
  173. this.keepTrailingSpace(node, selector);
  174. this.checkCurly(selector);
  175. this.raw(node, 'selector', selector);
  176. };
  177. /* Helpers */
  178. Parser.prototype.indent = function indent(part) {
  179. var indent = part.indent.length;
  180. var isPrev = typeof this.prevIndent !== 'undefined';
  181. if (!isPrev && indent) this.indentedFirstLine(part);
  182. if (!this.step && indent) {
  183. this.step = indent;
  184. this.root.raws.indent = part.indent;
  185. }
  186. if (isPrev && this.prevIndent !== indent) {
  187. var diff = indent - this.prevIndent;
  188. if (diff > 0) {
  189. if (diff !== this.step) {
  190. this.wrongIndent(this.prevIndent + this.step, indent, part);
  191. } else if (this.current.last.push) {
  192. this.current = this.current.last;
  193. } else {
  194. this.extraIndent = '';
  195. for (var i = 0; i < diff; i++) {
  196. this.extraIndent += ' ';
  197. }
  198. }
  199. } else if (diff % this.step !== 0) {
  200. var m = indent + diff % this.step;
  201. this.wrongIndent(m + ' or ' + (m + this.step), indent, part);
  202. } else {
  203. for (var _i2 = 0; _i2 < -diff / this.step; _i2++) {
  204. this.current = this.current.parent;
  205. }
  206. }
  207. }
  208. this.prevIndent = indent;
  209. };
  210. Parser.prototype.init = function init(node, part) {
  211. this.indent(part);
  212. if (!this.current.nodes) this.current.nodes = [];
  213. this.current.push(node);
  214. node.raws.before = part.before + part.indent;
  215. if (this.extraIndent) {
  216. node.raws.extraIndent = this.extraIndent;
  217. this.extraIndent = false;
  218. }
  219. node.source = {
  220. start: { line: part.tokens[0][2], column: part.tokens[0][3] },
  221. input: this.input
  222. };
  223. };
  224. Parser.prototype.checkCurly = function checkCurly(tokens) {
  225. for (var _iterator = tokens, _isArray = Array.isArray(_iterator), _i3 = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
  226. var _ref;
  227. if (_isArray) {
  228. if (_i3 >= _iterator.length) break;
  229. _ref = _iterator[_i3++];
  230. } else {
  231. _i3 = _iterator.next();
  232. if (_i3.done) break;
  233. _ref = _i3.value;
  234. }
  235. var token = _ref;
  236. if (token[0] === '{') {
  237. this.error('Unnecessary curly bracket', token[2], token[3]);
  238. }
  239. }
  240. };
  241. Parser.prototype.checkSemicolon = function checkSemicolon(tokens) {
  242. for (var _iterator2 = tokens, _isArray2 = Array.isArray(_iterator2), _i4 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
  243. var _ref2;
  244. if (_isArray2) {
  245. if (_i4 >= _iterator2.length) break;
  246. _ref2 = _iterator2[_i4++];
  247. } else {
  248. _i4 = _iterator2.next();
  249. if (_i4.done) break;
  250. _ref2 = _i4.value;
  251. }
  252. var token = _ref2;
  253. if (token[0] === ';') {
  254. this.error('Unnecessary semicolon', token[2], token[3]);
  255. }
  256. }
  257. };
  258. Parser.prototype.keepTrailingSpace = function keepTrailingSpace(node, tokens) {
  259. var lastSpace = tokens[tokens.length - 1];
  260. if (lastSpace && lastSpace[0] === 'space') {
  261. tokens.pop();
  262. node.raws.sssBetween = lastSpace[1];
  263. }
  264. };
  265. Parser.prototype.firstSpaces = function firstSpaces(tokens) {
  266. var result = '';
  267. for (var i = 0; i < tokens.length; i++) {
  268. if (tokens[i][0] === 'space' || tokens[i][0] === 'newline') {
  269. result += tokens.shift()[1];
  270. i -= 1;
  271. } else {
  272. break;
  273. }
  274. }
  275. return result;
  276. };
  277. Parser.prototype.raw = function raw(node, prop, tokens, altLast) {
  278. var token = void 0,
  279. type = void 0;
  280. var length = tokens.length;
  281. var value = '';
  282. var clean = true;
  283. for (var i = 0; i < length; i += 1) {
  284. token = tokens[i];
  285. type = token[0];
  286. if (type === 'comment' || type === 'space' && i === length - 1) {
  287. clean = false;
  288. } else {
  289. value += token[1];
  290. }
  291. }
  292. if (!clean) {
  293. var sss = tokens.reduce(function (all, i) {
  294. return all + i[1];
  295. }, '');
  296. var raw = tokens.reduce(function (all, i) {
  297. if (i[0] === 'comment' && i[6] === 'inline') {
  298. return all + '/* ' + i[1].slice(2).trim() + ' */';
  299. } else {
  300. return all + i[1];
  301. }
  302. }, '');
  303. node.raws[prop] = { value: value, raw: raw };
  304. if (sss !== raw) node.raws[prop].sss = sss;
  305. }
  306. node[prop] = value;
  307. var last = void 0;
  308. for (var _i5 = tokens.length - 1; _i5 >= 0; _i5--) {
  309. if (tokens[_i5].length > 2) {
  310. last = tokens[_i5];
  311. break;
  312. }
  313. }
  314. if (!last) last = altLast;
  315. node.source.end = {
  316. line: last[4] || last[2],
  317. column: last[5] || last[3]
  318. };
  319. };
  320. Parser.prototype.nextNonComment = function nextNonComment(pos) {
  321. var next = pos;
  322. var part = void 0;
  323. while (next < this.parts.length) {
  324. next += 1;
  325. part = this.parts[next];
  326. if (part.end || !part.comment) break;
  327. }
  328. return part;
  329. };
  330. Parser.prototype.commentText = function commentText(node, token) {
  331. var text = token[1];
  332. if (token[6] === 'inline') {
  333. node.raws.inline = true;
  334. text = text.slice(2);
  335. } else {
  336. text = text.slice(2, -2);
  337. }
  338. var match = text.match(/^(\s*)([^]*[^\s])(\s*)\n?$/);
  339. if (match) {
  340. node.text = match[2];
  341. node.raws.left = match[1];
  342. node.raws.inlineRight = match[3];
  343. } else {
  344. node.text = '';
  345. node.raws.left = '';
  346. node.raws.inlineRight = '';
  347. }
  348. };
  349. // Errors
  350. Parser.prototype.error = function error(msg, line, column) {
  351. throw this.input.error(msg, line, column);
  352. };
  353. Parser.prototype.unnamedAtrule = function unnamedAtrule(token) {
  354. this.error('At-rule without name', token[2], token[3]);
  355. };
  356. Parser.prototype.unnamedDecl = function unnamedDecl(token) {
  357. this.error('Declaration without name', token[2], token[3]);
  358. };
  359. Parser.prototype.indentedFirstLine = function indentedFirstLine(part) {
  360. this.error('First line should not have indent', part.number, 1);
  361. };
  362. Parser.prototype.wrongIndent = function wrongIndent(expected, real, part) {
  363. var msg = 'Expected ' + expected + ' indent, but get ' + real;
  364. this.error(msg, part.number, 1);
  365. };
  366. Parser.prototype.badProp = function badProp(token) {
  367. this.error('Unexpected separator in property', token[2], token[3]);
  368. };
  369. return Parser;
  370. }();
  371. exports.default = Parser;
  372. module.exports = exports['default'];
  373. //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInBhcnNlci5lczYiXSwibmFtZXMiOlsiUGFyc2VyIiwiaW5wdXQiLCJwb3MiLCJyb290IiwiUm9vdCIsImN1cnJlbnQiLCJzcGFjZXMiLCJleHRyYUluZGVudCIsInByZXZJbmRlbnQiLCJ1bmRlZmluZWQiLCJzdGVwIiwic291cmNlIiwic3RhcnQiLCJsaW5lIiwiY29sdW1uIiwibG9vcCIsInBhcnQiLCJwYXJ0cyIsImxlbmd0aCIsImNvbW1lbnQiLCJhdHJ1bGUiLCJjb2xvbiIsIm5leHQiLCJuZXh0Tm9uQ29tbWVudCIsImVuZCIsImRlY2wiLCJtb3JlSW5kZW50IiwiaW5kZW50IiwicnVsZSIsInJhd3MiLCJhZnRlciIsImJlZm9yZSIsImkiLCJ0b2tlbnMiLCJsYXN0IiwidG9rZW4iLCJub2RlIiwiQ29tbWVudCIsImluaXQiLCJjb21tZW50VGV4dCIsImF0d29yZCIsInBhcmFtcyIsInNsaWNlIiwiQXRSdWxlIiwibmFtZSIsInVubmFtZWRBdHJ1bGUiLCJsYXN0Q29tbWEiLCJwdXNoIiwiY29uY2F0IiwiYWZ0ZXJOYW1lIiwiZmlyc3RTcGFjZXMiLCJrZWVwVHJhaWxpbmdTcGFjZSIsImNoZWNrU2VtaWNvbG9uIiwiY2hlY2tDdXJseSIsInJhdyIsIkRlY2xhcmF0aW9uIiwiYmV0d2VlbiIsInZhbHVlIiwicHJvcCIsImJhZFByb3AiLCJ1bm5hbWVkRGVjbCIsInBvcCIsInByZXYiLCJ0IiwiaW1wb3J0YW50Iiwic3BsaWNlIiwiUnVsZSIsInNlbG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IG0gKyB0aGlzLnN0ZXAgfWAsIGluZGVudCwgcGFydClcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgLWRpZmYgLyB0aGlzLnN0ZXA7IGkrKykge1xuICAgICAgICAgIHRoaXMuY3VycmVudCA9IHRoaXMuY3VycmVudC5wYXJlbnRcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH1cblxuICAgIHRoaXMucHJldkluZGVudCA9IGluZGVudFxuICB9XG5cbiAgaW5pdCAobm9kZSwgcGFydCkge1xuICAgIHRoaXMuaW5kZW50KHBhcnQpXG5cbiAgICBpZiAoIXRoaXMuY3VycmVudC5ub2RlcykgdGhpcy5jdXJyZW50Lm5vZGVzID0gW11cbiAgICB0aGlzLmN1cnJlbnQucHVzaChub2RlKVxuXG4gICAgbm9kZS5yYXdzLmJlZm9yZSA9IHBhcnQuYmVmb3JlICsgcGFydC5pbmRlbnRcbiAgICBpZiAodGhpcy5leHRyYUluZGVudCkge1xuICAgICAgbm9kZS5yYXdzLmV4dHJhSW5kZW50ID0gdGhpcy5leHRyYUluZGVudFxuICAgICAgdGhpcy5leHRyYUluZGVudCA9IGZhbHNlXG4gICAgfVxuICAgIG5vZGUuc291cmNlID0ge1xuICAgICAgc3RhcnQ6IHsgbGluZTogcGFydC50b2tlbnNbMF1bMl0sIGNvbHVtbjogcGFydC50b2tlbnNbMF1bM10gfSxcbiAgICAgIGlucHV0OiB0aGlzLmlucHV0XG4gICAgfVxuICB9XG5cbiAgY2hlY2tDdXJseSAodG9rZW5zKSB7XG4gICAgZm9yIChsZXQgdG9rZW4gb2YgdG9rZW5zKSB7XG4gICAgICBpZiAodG9rZW5bMF0gPT09ICd7Jykge1xuICAgICAgICB0aGlzLmVycm9yKCdVbm5lY2Vzc2FyeSBjdXJseSBicmFja2V0JywgdG9rZW5bMl0sIHRva2VuWzNdKVxuICAgICAgfVxuICAgIH1cbiAgfVxuXG4gIGNoZWNrU2VtaWNvbG9uICh0b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kgKz0gMSkge1xuICAgICAgdG9rZW4gPSB0b2tlbnNbaV1cbiAgICAgIHR5cGUgPSB0b2tlblswXVxuICAgICAgaWYgKHR5cGUgPT09ICdjb21tZW50JyB8fCAodHlwZSA9PT0gJ3NwYWNlJyAmJiBpID09PSBsZW5ndGggLSAxKSkge1xuICAgICAgICBjbGVhbiA9IGZhbHNlXG4gICAgICB9IGVsc2Uge1xuICAgICAgICB2YWx1ZSArPSB0b2tlblsxXVxuICAgICAgfVxuICAgIH1cbiAgICBpZiAoIWNsZWFuKSB7XG4gICAgICBsZXQgc3NzID0gdG9rZW5zLnJlZHVjZSgoYWxsLCBpKSA9PiBhbGwgKyBpWzFdLCAnJylcbiAgICAgIGxldCByYXcgPSB0b2tlbnMucmVkdWNlKChhbGwsIGkpID0+IHtcbiAgICAgICAgaWYgKGlbMF0gPT09ICdjb21tZW50JyAmJiBpWzZdID09PSAnaW5saW5lJykge1xuICAgICAgICAgIHJldHVybiBhbGwgKyAnLyogJyArIGlbMV0uc2xpY2UoMikudHJpbSgpICsgJyAqLydcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICByZXR1cm4gYWxsICsgaVsxXVxuICAgICAgICB9XG4gICAgICB9LCAnJylcbiAgICAgIG5vZGUucmF3c1twcm9wXSA9IHsgdmFsdWUsIHJhdyB9XG4gICAgICBpZiAoc3NzICE9PSByYXcpIG5vZGUucmF3c1twcm9wXS5zc3MgPSBzc3NcbiAgICB9XG4gICAgbm9kZVtwcm9wXSA9IHZhbHVlXG5cbiAgICBsZXQgbGFzdFxuICAgIGZvciAobGV0IGkgPSB0b2tlbnMubGVuZ3RoIC0gMTsgaSA+PSAwOyBpLS0pIHtcbiAgICAgIGlmICh0b2tlbnNbaV0ubGVuZ3RoID4gMikge1xuICAgICAgICBsYXN0ID0gdG9rZW5zW2ldXG4gICAgICAgIGJyZWFrXG4gICAgICB9XG4gICAgfVxuICAgIGlmICghbGFzdCkgbGFzdCA9IGFsdExhc3RcblxuICAgIG5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