Urara-Blog/node_modules/.pnpm-store/v3/files/21/b339c1a8262df547b1156de408028cb27805267407b6623bf42eb36b2afb9d4d997d758b8de8c10f8be0037f885329b8daa289cdb692fc8aace2a830bac747
2022-08-14 01:14:53 +08:00

19 lines
471 B
Text

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