Support notations where a listy thing can be written either all on one line:
{ key1: val1, key2: val2, key3: val3 }
or all on separate lines:
{
key1: val1,
key2: val2,
key3: val3
}
but not mixed:
{
key1: val1, key2: val2,
key3: val3
}
Right now this is impossible because choices inside repeat.join are always independent of each other.
Solution
This can be done with an if_flat construct (different than things I've called if_flat in the past...). if_flat(a, b) means "if inside a flat, then pick a otherwise pick b". Wadler can then be emulated by:
Support notations where a listy thing can be written either all on one line:
or all on separate lines:
but not mixed:
Right now this is impossible because choices inside repeat.join are always independent of each other.
Solution
This can be done with an
if_flat
construct (different than things I've calledif_flat
in the past...).if_flat(a, b)
means "if inside aflat
, then picka
otherwise pickb
". Wadler can then be emulated by:This will be very easy to implement once the NotationRef refactoring---where Indent and Flat are no longer exposed in NotationCase---is done.