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.

scss-parser.js 21KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. "use strict";
  2. function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
  3. var Comment = require('postcss/lib/comment');
  4. var Parser = require('postcss/lib/parser');
  5. var NestedDeclaration = require('./nested-declaration');
  6. var scssTokenizer = require('./scss-tokenize');
  7. var ScssParser =
  8. /*#__PURE__*/
  9. function (_Parser) {
  10. _inheritsLoose(ScssParser, _Parser);
  11. function ScssParser() {
  12. return _Parser.apply(this, arguments) || this;
  13. }
  14. var _proto = ScssParser.prototype;
  15. _proto.createTokenizer = function createTokenizer() {
  16. this.tokenizer = scssTokenizer(this.input);
  17. };
  18. _proto.rule = function rule(tokens) {
  19. var withColon = false;
  20. var brackets = 0;
  21. var value = '';
  22. for (var _iterator = tokens, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
  23. var _ref;
  24. if (_isArray) {
  25. if (_i >= _iterator.length) break;
  26. _ref = _iterator[_i++];
  27. } else {
  28. _i = _iterator.next();
  29. if (_i.done) break;
  30. _ref = _i.value;
  31. }
  32. var _i2 = _ref;
  33. if (withColon) {
  34. if (_i2[0] !== 'comment' && _i2[0] !== '{') {
  35. value += _i2[1];
  36. }
  37. } else if (_i2[0] === 'space' && _i2[1].indexOf('\n') !== -1) {
  38. break;
  39. } else if (_i2[0] === '(') {
  40. brackets += 1;
  41. } else if (_i2[0] === ')') {
  42. brackets -= 1;
  43. } else if (brackets === 0 && _i2[0] === ':') {
  44. withColon = true;
  45. }
  46. }
  47. if (!withColon || value.trim() === '' || /^[a-zA-Z-:#]/.test(value)) {
  48. _Parser.prototype.rule.call(this, tokens);
  49. } else {
  50. tokens.pop();
  51. var node = new NestedDeclaration();
  52. this.init(node);
  53. var last = tokens[tokens.length - 1];
  54. if (last[4]) {
  55. node.source.end = {
  56. line: last[4],
  57. column: last[5]
  58. };
  59. } else {
  60. node.source.end = {
  61. line: last[2],
  62. column: last[3]
  63. };
  64. }
  65. while (tokens[0][0] !== 'word') {
  66. node.raws.before += tokens.shift()[1];
  67. }
  68. node.source.start = {
  69. line: tokens[0][2],
  70. column: tokens[0][3]
  71. };
  72. node.prop = '';
  73. while (tokens.length) {
  74. var type = tokens[0][0];
  75. if (type === ':' || type === 'space' || type === 'comment') {
  76. break;
  77. }
  78. node.prop += tokens.shift()[1];
  79. }
  80. node.raws.between = '';
  81. var token;
  82. while (tokens.length) {
  83. token = tokens.shift();
  84. if (token[0] === ':') {
  85. node.raws.between += token[1];
  86. break;
  87. } else {
  88. node.raws.between += token[1];
  89. }
  90. }
  91. if (node.prop[0] === '_' || node.prop[0] === '*') {
  92. node.raws.before += node.prop[0];
  93. node.prop = node.prop.slice(1);
  94. }
  95. node.raws.between += this.spacesAndCommentsFromStart(tokens);
  96. this.precheckMissedSemicolon(tokens);
  97. for (var i = tokens.length - 1; i > 0; i--) {
  98. token = tokens[i];
  99. if (token[1] === '!important') {
  100. node.important = true;
  101. var string = this.stringFrom(tokens, i);
  102. string = this.spacesFromEnd(tokens) + string;
  103. if (string !== ' !important') {
  104. node.raws.important = string;
  105. }
  106. break;
  107. } else if (token[1] === 'important') {
  108. var cache = tokens.slice(0);
  109. var str = '';
  110. for (var j = i; j > 0; j--) {
  111. var _type = cache[j][0];
  112. if (str.trim().indexOf('!') === 0 && _type !== 'space') {
  113. break;
  114. }
  115. str = cache.pop()[1] + str;
  116. }
  117. if (str.trim().indexOf('!') === 0) {
  118. node.important = true;
  119. node.raws.important = str;
  120. tokens = cache;
  121. }
  122. }
  123. if (token[0] !== 'space' && token[0] !== 'comment') {
  124. break;
  125. }
  126. }
  127. this.raw(node, 'value', tokens);
  128. if (node.value.indexOf(':') !== -1) {
  129. this.checkMissedSemicolon(tokens);
  130. }
  131. this.current = node;
  132. }
  133. };
  134. _proto.comment = function comment(token) {
  135. if (token[6] === 'inline') {
  136. var node = new Comment();
  137. this.init(node, token[2], token[3]);
  138. node.raws.inline = true;
  139. node.source.end = {
  140. line: token[4],
  141. column: token[5]
  142. };
  143. var text = token[1].slice(2);
  144. if (/^\s*$/.test(text)) {
  145. node.text = '';
  146. node.raws.left = text;
  147. node.raws.right = '';
  148. } else {
  149. var match = text.match(/^(\s*)([^]*[^\s])(\s*)$/);
  150. var fixed = match[2].replace(/(\*\/|\/\*)/g, '*//*');
  151. node.text = fixed;
  152. node.raws.left = match[1];
  153. node.raws.right = match[3];
  154. node.raws.text = match[2];
  155. }
  156. } else {
  157. _Parser.prototype.comment.call(this, token);
  158. }
  159. };
  160. _proto.raw = function raw(node, prop, tokens) {
  161. _Parser.prototype.raw.call(this, node, prop, tokens);
  162. if (node.raws[prop]) {
  163. var scss = node.raws[prop].raw;
  164. node.raws[prop].raw = tokens.reduce(function (all, i) {
  165. if (i[0] === 'comment' && i[6] === 'inline') {
  166. var text = i[1].slice(2).replace(/(\*\/|\/\*)/g, '*//*');
  167. return all + '/*' + text + '*/';
  168. } else {
  169. return all + i[1];
  170. }
  171. }, '');
  172. if (scss !== node.raws[prop].raw) {
  173. node.raws[prop].scss = scss;
  174. }
  175. }
  176. };
  177. return ScssParser;
  178. }(Parser);
  179. module.exports = ScssParser;
  180. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNjc3MtcGFyc2VyLmVzNiJdLCJuYW1lcyI6WyJDb21tZW50Iiw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0gJydcblxuICAgICAgbGV0IHRva2VuXG4gICAgICB3aGlsZSAodG9rZW5zLmxlbmd0aCkge1xuICAgICAgICB0b2tlbiA9IHRva2Vucy5zaGlmdCgpXG5cbiAgICAgICAgaWYgKHRva2VuWzBdID09PSAnOicpIHtcbiAgICAgICAgICBub2RlLnJhd3MuYmV0d2VlbiArPSB0b2tlblsxXVxuICAgICAgICAgIGJyZWFrXG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgbm9kZS5yYXdzLmJldHdlZW4gKz0gdG9rZW5bMV1cbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICBpZiAobm9kZS5wcm9wWzBdID09PSAnXycgfHwgbm9kZS5wcm9wWzBdID09PSAnKicpIHtcbiAgICAgICAgbm9kZS5yYXdzLmJlZm9yZSArPSBub2RlLnByb3BbMF1cbiAgICAgICAgbm9kZS5wcm9wID0gbm9kZS5wcm9wLnNsaWNlKDEpXG4gICAgICB9XG4gICAgICBub2RlLnJhd3MuYmV0d2VlbiArPSB0aGlzLnNwYWNlc0FuZENvbW1lbnRzRnJvbVN0YXJ0KHRva2VucylcbiAgICAgIHRoaXMucHJlY2hlY2tNaXNzZWRTZW1pY29sb24odG9rZW5zKVxuXG4gICAgICBmb3IgKGxldCBpID0gdG9rZW5zLmxlbmd0aCAtIDE7IGkgPiAwOyBpLS0pIHtcbiAgICAgICAgdG9rZW4gPSB0b2tlbnNbaV1cbiAgICAgICAgaWYgKHRva2VuWzFdID09PSAnIWltcG9ydGFudCcpIHtcbiAgICAgICAgICBub2RlLmltcG9ydGFudCA9IHRydWVcbiAgICAgICAgICBsZXQgc3RyaW5nID0gdGhpcy5zdHJpbmdGcm9tKHRva2VucywgaSlcbiAgICAgICAgICBzdHJpbmcgPSB0aGlzLnNwYWNlc0Zyb21FbmQodG9rZW5zKSArIHN0cmluZ1xuICAgICAgICAgIGlmIChzdHJpbmcgIT09ICcgIWltcG9ydGFudCcpIHtcbiAgICAgICAgICAgIG5vZGUucmF3cy5pbXBvcnRhbnQgPSBzdHJpbmdcbiAgICAgICAgICB9XG4gICAgICAgICAgYnJlYWtcbiAgICAgICAgfSBlbHNlIGlmICh0b2tlblsxXSA9PT0gJ2ltcG9ydGFudCcpIHtcbiAgICAgICAgICBsZXQgY2FjaGUgPSB0b2tlbnMuc2xpY2UoMClcbiAgICAgICAgICBsZXQgc3RyID0gJydcbiAgICAgICAgICBmb3IgKGxldCBqID0gaTsgaiA+IDA7IGotLSkge1xuICAgICAgICAgICAgbGV0IHR5cGUgPSBjYWNoZVtqXVswXVxuICAgICAgICAgICAgaWYgKHN0ci50cmltKCkuaW5kZXhPZignIScpID09PSAwICYmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZSAhPT0gJ3NwYWNlJ1xuICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgIGJyZWFrXG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBzdHIgPSBjYWNoZS5wb3AoKVsxXSArIHN0clxuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAoc3RyLnRyaW0oKS5pbmRleE9mKCchJykgPT09IDApIHtcbiAgICAgICAgICAgIG5vZGUuaW1wb3J0YW50ID0gdHJ1ZVxuICAgICAgICAgICAgbm9kZS5yYXdzLmltcG9ydGFudCA9IHN0clxuICAgICAgICAgICAgdG9rZW5zID0gY2FjaGVcbiAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBpZiAodG9rZW5bMF0gIT09ICdzcGFjZScgJiYgdG9rZW5bMF0gIT09ICdjb21tZW50Jykge1xuICAgICAgICAgIGJyZWFrXG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgdGhpcy5yYXcobm9kZSwgJ3ZhbHVlJywgdG9rZW5zKVxuXG4gICAgICBpZiAobm9kZS52YWx1ZS5pbmRleE9mKCc6JykgIT09IC0xKSB7XG4gICAgICAgIHRoaXMuY2hlY2tNaXNzZWRTZW1pY29sb24odG9rZW5zKVxuICAgICAgfVxuXG4gICAgICB0aGl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