mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 22:09:09 +00:00
Introduce record!
combinator
... and refactor header parser to fully use combinators, in support of future combinator-based superpowers
This commit is contained in:
parent
ec6db293f5
commit
2b91af02df
26 changed files with 1709 additions and 1486 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue