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
542 B

1 month ago
  1. var TYPE = require('../../tokenizer').TYPE;
  2. var HASH = TYPE.Hash;
  3. // '#' ident
  4. module.exports = {
  5. name: 'Hash',
  6. structure: {
  7. value: String
  8. },
  9. parse: function() {
  10. var start = this.scanner.tokenStart;
  11. this.eat(HASH);
  12. return {
  13. type: 'Hash',
  14. loc: this.getLocation(start, this.scanner.tokenStart),
  15. value: this.scanner.substrToCursor(start + 1)
  16. };
  17. },
  18. generate: function(node) {
  19. this.chunk('#');
  20. this.chunk(node.value);
  21. }
  22. };