source: trip-planner-front/node_modules/css-tree/lib/syntax/node/IdSelector.js@ 6a3a178

Last change on this file since 6a3a178 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 595 bytes
Line 
1var TYPE = require('../../tokenizer').TYPE;
2
3var HASH = TYPE.Hash;
4
5// <hash-token>
6module.exports = {
7 name: 'IdSelector',
8 structure: {
9 name: String
10 },
11 parse: function() {
12 var start = this.scanner.tokenStart;
13
14 // TODO: check value is an ident
15 this.eat(HASH);
16
17 return {
18 type: 'IdSelector',
19 loc: this.getLocation(start, this.scanner.tokenStart),
20 name: this.scanner.substrToCursor(start + 1)
21 };
22 },
23 generate: function(node) {
24 this.chunk('#');
25 this.chunk(node.name);
26 }
27};
Note: See TracBrowser for help on using the repository browser.