a2ebbe85f5a69d3ad828f5fa86513097438850859f1b24f1a2f6eca4f0901b19f085be66e058abac5d2095af73698b49434547b34b857bc05a8372b274b84c 550 B

1234567891011121314151617181920212223242526
  1. var TYPE = require('../../tokenizer').TYPE;
  2. var HASH = TYPE.Hash;
  3. // '#' ident
  4. module.exports = {
  5. name: 'HexColor',
  6. structure: {
  7. value: String
  8. },
  9. parse: function() {
  10. var start = this.scanner.tokenStart;
  11. this.eat(HASH);
  12. return {
  13. type: 'HexColor',
  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. };