aboutsummaryrefslogtreecommitdiffstats
path: root/vanilla/node_modules/css-tree/lib/syntax/node/Layer.js
blob: d170dcb59e876b1148e07daad575835fa8352fa8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import { Ident, Delim } from '../../tokenizer/index.js';

const FULLSTOP = 0x002E; // U+002E FULL STOP (.)

export const name = 'Layer';
export const structure = {
    name: String
};

export function parse() {
    let tokenStart = this.tokenStart;
    let name = this.consume(Ident);

    while (this.isDelim(FULLSTOP)) {
        this.eat(Delim);
        name += '.' + this.consume(Ident);
    }

    return {
        type: 'Layer',
        loc: this.getLocation(tokenStart, this.tokenStart),
        name
    };
}

export function generate(node) {
    this.tokenize(node.name);
}