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.

20 lines
441 B

4 years ago
  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. };