Urara-Blog/node_modules/.pnpm-store/v3/files/ce/5174ebf6902df9d767b7afa035ed88b9eef2e6a7d38d9563cc776db3b4437bed3055e3d351326f4db6dddb3544748ddc4c94cdc7edc7e751ec2cb93def9f1d
2022-08-14 01:14:53 +08:00

30 lines
642 B
Text

'use strict';
const types = require('../../tokenizer/types.cjs');
const name = 'Dimension';
const structure = {
value: String,
unit: String
};
function parse() {
const start = this.tokenStart;
const value = this.consumeNumber(types.Dimension);
return {
type: 'Dimension',
loc: this.getLocation(start, this.tokenStart),
value,
unit: this.substring(start + value.length, this.tokenStart)
};
}
function generate(node) {
this.token(types.Dimension, node.value + node.unit);
}
exports.generate = generate;
exports.name = name;
exports.parse = parse;
exports.structure = structure;