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.

safe-parser.js 10KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. "use strict";
  2. function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
  3. var tokenizer = require('postcss/lib/tokenize');
  4. var Comment = require('postcss/lib/comment');
  5. var Parser = require('postcss/lib/parser');
  6. var SafeParser =
  7. /*#__PURE__*/
  8. function (_Parser) {
  9. _inheritsLoose(SafeParser, _Parser);
  10. function SafeParser() {
  11. return _Parser.apply(this, arguments) || this;
  12. }
  13. var _proto = SafeParser.prototype;
  14. _proto.createTokenizer = function createTokenizer() {
  15. this.tokenizer = tokenizer(this.input, {
  16. ignoreErrors: true
  17. });
  18. };
  19. _proto.comment = function comment(token) {
  20. var node = new Comment();
  21. this.init(node, token[2], token[3]);
  22. node.source.end = {
  23. line: token[4],
  24. column: token[5]
  25. };
  26. var text = token[1].slice(2);
  27. if (text.slice(-2) === '*/') text = text.slice(0, -2);
  28. if (/^\s*$/.test(text)) {
  29. node.text = '';
  30. node.raws.left = text;
  31. node.raws.right = '';
  32. } else {
  33. var match = text.match(/^(\s*)([^]*\S)(\s*)$/);
  34. node.text = match[2];
  35. node.raws.left = match[1];
  36. node.raws.right = match[3];
  37. }
  38. };
  39. _proto.decl = function decl(tokens) {
  40. if (tokens.length > 1 && tokens.some(function (i) {
  41. return i[0] === 'word';
  42. })) {
  43. _Parser.prototype.decl.call(this, tokens);
  44. }
  45. };
  46. _proto.unclosedBracket = function unclosedBracket() {};
  47. _proto.unknownWord = function unknownWord(tokens) {
  48. this.spaces += tokens.map(function (i) {
  49. return i[1];
  50. }).join('');
  51. };
  52. _proto.unexpectedClose = function unexpectedClose() {
  53. this.current.raws.after += '}';
  54. };
  55. _proto.doubleColon = function doubleColon() {};
  56. _proto.unnamedAtrule = function unnamedAtrule(node) {
  57. node.name = '';
  58. };
  59. _proto.precheckMissedSemicolon = function precheckMissedSemicolon(tokens) {
  60. var colon = this.colon(tokens);
  61. if (colon === false) return;
  62. var split;
  63. for (split = colon - 1; split >= 0; split--) {
  64. if (tokens[split][0] === 'word') break;
  65. }
  66. for (split -= 1; split >= 0; split--) {
  67. if (tokens[split][0] !== 'space') {
  68. split += 1;
  69. break;
  70. }
  71. }
  72. var other = tokens.splice(split, tokens.length - split);
  73. this.decl(other);
  74. };
  75. _proto.checkMissedSemicolon = function checkMissedSemicolon() {};
  76. _proto.endFile = function endFile() {
  77. if (this.current.nodes && this.current.nodes.length) {
  78. this.current.raws.semicolon = this.semicolon;
  79. }
  80. this.current.raws.after = (this.current.raws.after || '') + this.spaces;
  81. while (this.current.parent) {
  82. this.current = this.current.parent;
  83. this.current.raws.after = '';
  84. }
  85. };
  86. return SafeParser;
  87. }(Parser);
  88. module.exports = SafeParser;
  89. //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNhZmUtcGFyc2VyLmVzNiJdLCJuYW1lcyI6WyJ0b2tlbml6ZXIiLCJyZXF1aXJlIiwiQ29tbWVudCIsIlBhcnNlciIsIlNhZmVQYXJzZXIiLCJjcmVhdGVUb2tlbml6ZXIiLCJpbnB1dCIsImlnbm9yZUVycm9ycyIsImNvbW1lbnQiLCJ0b2tlbiIsIm5vZGUiLCJpbml0Iiwic291cmNlIiwiZW5kIiwibGluZSIsImNvbHVtbiIsInRleHQiLCJzbGljZSIsInRlc3QiLCJyYXdzIiwibGVmdCIsInJpZ2h0IiwibWF0Y2giLCJkZWNsIiwidG9rZW5zIiwibGVuZ3RoIiwic29tZSIsImkiLCJ1bmNsb3NlZEJyYWNrZXQiLCJ1bmtub3duV29yZCIsInNwYWNl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