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.
25 lines
578 B
25 lines
578 B
3 years ago
|
var TYPE = require('../../tokenizer').TYPE;
|
||
|
var IDENTIFIER = TYPE.Identifier;
|
||
|
var NUMBERSIGN = TYPE.NumberSign;
|
||
|
|
||
|
// '#' ident
|
||
|
module.exports = {
|
||
|
name: 'IdSelector',
|
||
|
structure: {
|
||
|
name: String
|
||
|
},
|
||
|
parse: function() {
|
||
|
this.scanner.eat(NUMBERSIGN);
|
||
|
|
||
|
return {
|
||
|
type: 'IdSelector',
|
||
|
loc: this.getLocation(this.scanner.tokenStart - 1, this.scanner.tokenEnd),
|
||
|
name: this.scanner.consume(IDENTIFIER)
|
||
|
};
|
||
|
},
|
||
|
generate: function(node) {
|
||
|
this.chunk('#');
|
||
|
this.chunk(node.name);
|
||
|
}
|
||
|
};
|