site/node_modules/css-tree/lib/syntax/node/String.js
2024-10-14 08:09:33 +02:00

20 lines
471 B
JavaScript

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));
}