2. Formatting
Converting a DUST document to DUST writes its canonical spelling: the same value
always formats to the same bytes. For example, epsilon convert input.dust
output.dust writes canonical DUST to output.dust. epsilon fmt keeps map
keys in source order, so its output is canonical only when the keys are sorted. Canonical output is what Epsilon prints,
what conformance fixtures store, and what hash digests, so two
programs that format alike are the same program.
The rules are those of RON and DUST. In brief, the formatter:
- sorts map keys and collects boolean members into a tag group;
- uses the short forms
.name,:name,(f x),`x, and\xfor locals, constants, invocations, quotes, and muted forms; - drops the brackets of a root list with two or more forms, writing one form per line;
- normalizes
#utcand#durpayloads, so#dur PT90Mbecomes#dur PT1H30M.