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.

liner.js 2.2KB

123456789101112131415161718192021222324252627282930313233343536
  1. 'use strict';
  2. exports.__esModule = true;
  3. exports.default = liner;
  4. function liner(tokens) {
  5. var line = [];
  6. var result = [line];
  7. var brackets = 0;
  8. for (var _iterator = tokens, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
  9. var _ref;
  10. if (_isArray) {
  11. if (_i >= _iterator.length) break;
  12. _ref = _iterator[_i++];
  13. } else {
  14. _i = _iterator.next();
  15. if (_i.done) break;
  16. _ref = _i.value;
  17. }
  18. var token = _ref;
  19. line.push(token);
  20. if (token[0] === '(') {
  21. brackets += 1;
  22. } else if (token[0] === ')') {
  23. brackets -= 1;
  24. } else if (token[0] === 'newline' && brackets === 0) {
  25. line = [];
  26. result.push(line);
  27. }
  28. }
  29. return result;
  30. }
  31. module.exports = exports['default'];
  32. //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImxpbmVyLmVzNiJdLCJuYW1lcyI6WyJsaW5lciIsInRva2VucyIsImxpbmUiLCJyZXN1bHQiLCJicmFja2V0cyIsInRva2VuIiwicHVzaCJdLCJtYXBwaW5ncyI6Ijs7O2tCQUF3QkEsSztBQUFULFNBQVNBLEtBQVQsQ0FBZ0JDLE1BQWhCLEVBQXdCO0FBQ3JDLE1BQUlDLE9BQU8sRUFBWDtBQUNBLE1BQUlDLFNBQVMsQ0FBQ0QsSUFBRCxDQUFiO0FBQ0EsTUFBSUUsV0FBVyxDQUFmO0FBQ0EsdUJBQWtCSCxNQUFsQixrSEFBMEI7QUFBQTs7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBOztBQUFBLFFBQWpCSSxLQUFp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