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.

flow.js 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. 'use strict'
  2. Object.defineProperty(exports, '__esModule', {value: true})
  3. var content = require('../tokenize/content.js')
  4. var factorySpace = require('../tokenize/factory-space.js')
  5. var partialBlankLine = require('../tokenize/partial-blank-line.js')
  6. var tokenize = initializeFlow
  7. function initializeFlow(effects) {
  8. var self = this
  9. var initial = effects.attempt(
  10. // Try to parse a blank line.
  11. partialBlankLine,
  12. atBlankEnding, // Try to parse initial flow (essentially, only code).
  13. effects.attempt(
  14. this.parser.constructs.flowInitial,
  15. afterConstruct,
  16. factorySpace(
  17. effects,
  18. effects.attempt(
  19. this.parser.constructs.flow,
  20. afterConstruct,
  21. effects.attempt(content, afterConstruct)
  22. ),
  23. 'linePrefix'
  24. )
  25. )
  26. )
  27. return initial
  28. function atBlankEnding(code) {
  29. if (code === null) {
  30. effects.consume(code)
  31. return
  32. }
  33. effects.enter('lineEndingBlank')
  34. effects.consume(code)
  35. effects.exit('lineEndingBlank')
  36. self.currentConstruct = undefined
  37. return initial
  38. }
  39. function afterConstruct(code) {
  40. if (code === null) {
  41. effects.consume(code)
  42. return
  43. }
  44. effects.enter('lineEnding')
  45. effects.consume(code)
  46. effects.exit('lineEnding')
  47. self.currentConstruct = undefined
  48. return initial
  49. }
  50. }
  51. exports.tokenize = tokenize