/* libxmq - Copyright (C) 2026 Fredrik Öhrström (spdx: MIT) */

// Format xmq, like the format command of an editor: parse the text and print it again,
// pretty with an indentation of 4 or 2, and compact on one line.

import { parse, print } from "libxmq-lite";

const text = "car(id=1){model=Volvo // The model.\n year=1999 owners{name='Anna Andersson'}}";

const doc = parse(text, { source: "car.xmq" });
console.log(print(doc));
console.log(print(doc, { indent: 2 }));
console.log(print(doc, { compact: true }));