This repository has been archived on 2024-07-27. You can view files and clone it, but cannot push or open issues or pull requests.
keksAccountGUI/node_modulesOLD/css-tree/lib/syntax/node/ClassSelector.js

31 lines
712 B
JavaScript
Raw Normal View History

2019-08-11 18:48:02 +00:00
var TYPE = require('../../tokenizer').TYPE;
var CHARCODE = require('../../tokenizer').CHARCODE;
var IDENT = TYPE.Ident;
var FULLSTOP = CHARCODE.FullStop;
// '.' 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);
}
};