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.

template-tokenize.js 948B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. "use strict";
  2. const tokenize = require("postcss/lib/tokenize");
  3. function templateTokenize () {
  4. const tokenizer = tokenize.apply(this, arguments);
  5. function nextToken () {
  6. const args = arguments;
  7. const returned = [];
  8. let token;
  9. let depth = 0;
  10. let line;
  11. let column;
  12. while ((token = tokenizer.nextToken.apply(tokenizer, args))) {
  13. if (token[0] !== "word") {
  14. if (token[0] === "{") {
  15. ++depth;
  16. } else if (token[0] === "}") {
  17. --depth;
  18. }
  19. }
  20. if (depth || returned.length) {
  21. line = token[4] || token[2] || line;
  22. column = token[5] || token[3] || column;
  23. returned.push(token);
  24. }
  25. if (!depth) {
  26. break;
  27. }
  28. }
  29. if (returned.length) {
  30. token = [
  31. "word",
  32. returned.map(token => token[1]).join(""),
  33. returned[0][2],
  34. returned[0][3],
  35. line,
  36. column,
  37. ];
  38. }
  39. return token;
  40. }
  41. return Object.assign({}, tokenizer, {
  42. nextToken,
  43. });
  44. }
  45. module.exports = templateTokenize;