Identifier.js 376 B

123456789101112131415161718
  1. import { Ident } from '../../tokenizer/index.js';
  2. export const name = 'Identifier';
  3. export const structure = {
  4. name: String
  5. };
  6. export function parse() {
  7. return {
  8. type: 'Identifier',
  9. loc: this.getLocation(this.tokenStart, this.tokenEnd),
  10. name: this.consume(Ident)
  11. };
  12. }
  13. export function generate(node) {
  14. this.token(Ident, node.name);
  15. }