Identifier.js 441 B

1234567891011121314151617181920
  1. var TYPE = require('../../tokenizer').TYPE;
  2. var IDENT = TYPE.Ident;
  3. module.exports = {
  4. name: 'Identifier',
  5. structure: {
  6. name: String
  7. },
  8. parse: function() {
  9. return {
  10. type: 'Identifier',
  11. loc: this.getLocation(this.scanner.tokenStart, this.scanner.tokenEnd),
  12. name: this.consume(IDENT)
  13. };
  14. },
  15. generate: function(node) {
  16. this.chunk(node.name);
  17. }
  18. };