mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 05:49:08 +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
|
@ -330,6 +330,7 @@ pub enum EExpr<'a> {
|
|||
Start(Position),
|
||||
End(Position),
|
||||
BadExprEnd(Position),
|
||||
StmtAfterExpr(Position),
|
||||
Space(BadInputError, Position),
|
||||
|
||||
Dot(Position),
|
||||
|
@ -355,6 +356,8 @@ pub enum EExpr<'a> {
|
|||
QualifiedTag(Position),
|
||||
BackpassComma(Position),
|
||||
BackpassArrow(Position),
|
||||
BackpassContinue(Position),
|
||||
DbgContinue(Position),
|
||||
|
||||
When(EWhen<'a>, Position),
|
||||
If(EIf<'a>, Position),
|
||||
|
@ -383,6 +386,7 @@ pub enum EExpr<'a> {
|
|||
IndentEnd(Position),
|
||||
|
||||
UnexpectedComma(Position),
|
||||
UnexpectedTopLevelExpr(Position),
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
|
@ -851,8 +855,9 @@ where
|
|||
let cur_indent = INDENT.with(|i| *i.borrow());
|
||||
|
||||
println!(
|
||||
"{:<5?}: {}{:<50}",
|
||||
"{:<5?}:{:<2} {}{:<50}",
|
||||
state.pos(),
|
||||
min_indent,
|
||||
&indent_text[..cur_indent * 2],
|
||||
self.message
|
||||
);
|
||||
|
@ -868,8 +873,9 @@ where
|
|||
};
|
||||
|
||||
println!(
|
||||
"{:<5?}: {}{:<50} {:<15} {:?}",
|
||||
"{:<5?}:{:<2} {}{:<50} {:<15} {:?}",
|
||||
state.pos(),
|
||||
min_indent,
|
||||
&indent_text[..cur_indent * 2],
|
||||
self.message,
|
||||
format!("{:?}", progress),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue