aboutsummaryrefslogtreecommitdiffstats
path: root/vanilla/node_modules/css-tree/lib/syntax/node/String.js
blob: 95e1aaa5d8d943d75c1f8acb80ef54430f731a61 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import { String as StringToken } from '../../tokenizer/index.js';
import { decode, encode } from '../../utils/string.js';

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

export function parse() {
    return {
        type: 'String',
        loc: this.getLocation(this.tokenStart, this.tokenEnd),
        value: decode(this.consume(StringToken))
    };
}

export function generate(node) {
    this.token(StringToken, encode(node.value));
}