Hash.js 542 B

1234567891011121314151617181920212223242526
  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. };