Layer.js 582 B

12345678910111213141516171819202122232425262728
  1. import { Ident, Delim } from '../../tokenizer/index.js';
  2. const FULLSTOP = 0x002E; // U+002E FULL STOP (.)
  3. export const name = 'Layer';
  4. export const structure = {
  5. name: String
  6. };
  7. export function parse() {
  8. let tokenStart = this.tokenStart;
  9. let name = this.consume(Ident);
  10. while (this.isDelim(FULLSTOP)) {
  11. this.eat(Delim);
  12. name += '.' + this.consume(Ident);
  13. }
  14. return {
  15. type: 'Layer',
  16. loc: this.getLocation(tokenStart, this.tokenStart),
  17. name
  18. };
  19. }
  20. export function generate(node) {
  21. this.tokenize(node.name);
  22. }