mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 06:14:46 +00:00
Implement block / indent based parsing
... and enforce that defs can only occur in blocks (or, inside parenthesized expressions)
This commit is contained in:
parent
d5db3137a3
commit
4f32f43048
304 changed files with 12050 additions and 8876 deletions
|
@ -3,10 +3,8 @@ use std::cmp::max;
|
|||
use crate::annotation::{is_collection_multiline, Formattable, Newlines, Parens};
|
||||
use crate::collection::{fmt_collection, Braces};
|
||||
use crate::expr::fmt_str_literal;
|
||||
use crate::spaces::RemoveSpaces;
|
||||
use crate::spaces::{fmt_comments_only, fmt_default_spaces, fmt_spaces, NewlineAt, INDENT};
|
||||
use crate::Buf;
|
||||
use bumpalo::Bump;
|
||||
use roc_parse::ast::{Collection, CommentOrNewline, Header, Module, Spaced, Spaces};
|
||||
use roc_parse::header::{
|
||||
AppHeader, ExposedName, ExposesKeyword, GeneratesKeyword, HostedHeader, ImportsEntry,
|
||||
|
@ -58,12 +56,6 @@ macro_rules! keywords {
|
|||
buf.push_str($name::KEYWORD);
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> RemoveSpaces<'a> for $name {
|
||||
fn remove_spaces(&self, _arena: &'a Bump) -> Self {
|
||||
*self
|
||||
}
|
||||
}
|
||||
)*
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue