WhiteSpace.cjs 644 B

12345678910111213141516171819202122232425262728293031323334
  1. 'use strict';
  2. const types = require('../../tokenizer/types.cjs');
  3. const SPACE = Object.freeze({
  4. type: 'WhiteSpace',
  5. loc: null,
  6. value: ' '
  7. });
  8. const name = 'WhiteSpace';
  9. const structure = {
  10. value: String
  11. };
  12. function parse() {
  13. this.eat(types.WhiteSpace);
  14. return SPACE;
  15. // return {
  16. // type: 'WhiteSpace',
  17. // loc: this.getLocation(this.tokenStart, this.tokenEnd),
  18. // value: this.consume(WHITESPACE)
  19. // };
  20. }
  21. function generate(node) {
  22. this.token(types.WhiteSpace, node.value);
  23. }
  24. exports.generate = generate;
  25. exports.name = name;
  26. exports.parse = parse;
  27. exports.structure = structure;