Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/flo-bit/shapecraft. flo-bit.dev/shapecraft
Something went wrong. Try again.
540 B · 23 lines
JavaScript
at commit da69385e
123456789101112131415161718192021222324import { Dimension } from '../../tokenizer/index.js';
export const name = 'Dimension';export const structure = { value: String, unit: String};
export function parse() { const start = this.tokenStart; const value = this.consumeNumber(Dimension);
return { type: 'Dimension', loc: this.getLocation(start, this.tokenStart), value, unit: this.substring(start + value.length, this.tokenStart) };}
export function generate(node) { this.token(Dimension, node.value + node.unit);}