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.

26 lines
595 B

4 years ago
  1. var WHITESPACE = require('../../tokenizer').TYPE.WhiteSpace;
  2. var SPACE = Object.freeze({
  3. type: 'WhiteSpace',
  4. loc: null,
  5. value: ' '
  6. });
  7. module.exports = {
  8. name: 'WhiteSpace',
  9. structure: {
  10. value: String
  11. },
  12. parse: function() {
  13. this.eat(WHITESPACE);
  14. return SPACE;
  15. // return {
  16. // type: 'WhiteSpace',
  17. // loc: this.getLocation(this.scanner.tokenStart, this.scanner.tokenEnd),
  18. // value: this.consume(WHITESPACE)
  19. // };
  20. },
  21. generate: function(node) {
  22. this.chunk(node.value);
  23. }
  24. };