Urara-Blog/node_modules/.pnpm-store/v3/files/a4/136ce124f349adfdeae09e267ab3e584f8b56b2cd334301fed8c6fde931896e1e40fb978247020800b73cc1eb25b2aa86346dfa0c849698bb4b8dce4af74d9
2022-08-14 01:14:53 +08:00

29 lines
673 B
Text

var TYPE = require('../../tokenizer').TYPE;
var IDENT = TYPE.Ident;
var FULLSTOP = 0x002E; // U+002E FULL STOP (.)
// '.' ident
module.exports = {
name: 'ClassSelector',
structure: {
name: String
},
parse: function() {
if (!this.scanner.isDelim(FULLSTOP)) {
this.error('Full stop is expected');
}
this.scanner.next();
return {
type: 'ClassSelector',
loc: this.getLocation(this.scanner.tokenStart - 1, this.scanner.tokenEnd),
name: this.consume(IDENT)
};
},
generate: function(node) {
this.chunk('.');
this.chunk(node.name);
}
};