mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 00:24:34 +00:00
fix indent issue when parsing tag unions
This commit is contained in:
parent
ba0408a587
commit
c8e554e119
3 changed files with 19 additions and 7 deletions
|
@ -1,7 +1,7 @@
|
|||
use crate::ast::CommentOrNewline;
|
||||
use crate::ast::Spaceable;
|
||||
use crate::parser::{
|
||||
self, and, BadInputError, Col, Parser,
|
||||
self, and, backtrackable, BadInputError, Col, Parser,
|
||||
Progress::{self, *},
|
||||
Row, State,
|
||||
};
|
||||
|
@ -28,7 +28,10 @@ where
|
|||
space0_e(min_indent, space_problem, indent_before_problem),
|
||||
and(
|
||||
parser,
|
||||
space0_e(min_indent, space_problem, indent_after_problem),
|
||||
one_of![
|
||||
backtrackable(space0_e(min_indent, space_problem, indent_after_problem)),
|
||||
succeed!(&[] as &[_]),
|
||||
],
|
||||
),
|
||||
),
|
||||
move |arena: &'a Bump,
|
||||
|
|
|
@ -1299,6 +1299,15 @@ macro_rules! collection_trailing_sep_e {
|
|||
};
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! succeed {
|
||||
($value:expr) => {
|
||||
move |_arena: &'a bumpalo::Bump, state: $crate::parser::State<'a>| {
|
||||
Ok((NoProgress, $value, state))
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! and {
|
||||
($p1:expr, $p2:expr) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue