Introduce record! combinator

... and refactor header parser to fully use combinators, in support of future combinator-based superpowers
This commit is contained in:
Joshua Warner 2022-11-26 09:48:34 -08:00
parent ec6db293f5
commit 2b91af02df
No known key found for this signature in database
GPG key ID: 89AD497003F93FDD
26 changed files with 1709 additions and 1486 deletions

View file

@ -1,7 +1,7 @@
use roc_parse::ast::{Collection, CommentOrNewline, ExtractSpaces};
use crate::{
annotation::{Formattable, Newlines},
annotation::{is_collection_multiline, Formattable, Newlines},
spaces::{fmt_comments_only, NewlineAt, INDENT},
Buf,
};
@ -34,7 +34,7 @@ pub fn fmt_collection<'a, 'buf, T: ExtractSpaces<'a> + Formattable>(
Braces::Square => ']',
};
if items.is_multiline() {
if is_collection_multiline(&items) {
let braces_indent = indent;
let item_indent = braces_indent + INDENT;
if newline == Newlines::Yes {