UNPKG

react-kiwi-dropdown

Version:

| Name | Type | Description | | --------------------------- | -------------------- | ----------- | | options | array | | selectedOption | string | | onCha

25 lines (22 loc) 578 B
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); } };