mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 14:54:47 +00:00
cleanup
This commit is contained in:
parent
9442914fb6
commit
b18bd26067
2 changed files with 2 additions and 18 deletions
|
@ -296,28 +296,13 @@ fn expr_in_parens_then_arguments<'a>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn in_parens_region_fix<'a>(min_indent: u16) -> impl Parser<'a, Located<Expr<'a>>, EExpr<'a>> {
|
|
||||||
// we get the region of the expression inside the parens, but current tests want us to
|
|
||||||
// include the parentheses in the region
|
|
||||||
// map!(
|
|
||||||
// loc!(loc_expr_in_parens_etc_help(min_indent)),
|
|
||||||
// |loc_loc_expr: Located<Located<Expr<'a>>>| {
|
|
||||||
// let value = loc_loc_expr.value.value;
|
|
||||||
// let region = loc_loc_expr.region;
|
|
||||||
//
|
|
||||||
// Located::at(region, value)
|
|
||||||
// }
|
|
||||||
// )
|
|
||||||
loc_expr_in_parens_etc_help(min_indent)
|
|
||||||
}
|
|
||||||
|
|
||||||
fn parse_loc_term<'a>(
|
fn parse_loc_term<'a>(
|
||||||
min_indent: u16,
|
min_indent: u16,
|
||||||
arena: &'a Bump,
|
arena: &'a Bump,
|
||||||
state: State<'a>,
|
state: State<'a>,
|
||||||
) -> ParseResult<'a, Located<Expr<'a>>, EExpr<'a>> {
|
) -> ParseResult<'a, Located<Expr<'a>>, EExpr<'a>> {
|
||||||
one_of!(
|
one_of!(
|
||||||
in_parens_region_fix(min_indent),
|
loc_expr_in_parens_etc_help(min_indent),
|
||||||
loc!(specialize(EExpr::Str, string_literal_help())),
|
loc!(specialize(EExpr::Str, string_literal_help())),
|
||||||
loc!(specialize(EExpr::Number, number_literal_help())),
|
loc!(specialize(EExpr::Number, number_literal_help())),
|
||||||
loc!(specialize(EExpr::Lambda, closure_help(min_indent))),
|
loc!(specialize(EExpr::Lambda, closure_help(min_indent))),
|
||||||
|
@ -334,7 +319,7 @@ fn parse_loc_term_better<'a>(
|
||||||
state: State<'a>,
|
state: State<'a>,
|
||||||
) -> ParseResult<'a, Located<Expr<'a>>, EExpr<'a>> {
|
) -> ParseResult<'a, Located<Expr<'a>>, EExpr<'a>> {
|
||||||
one_of!(
|
one_of!(
|
||||||
in_parens_region_fix(min_indent),
|
loc_expr_in_parens_etc_help(min_indent),
|
||||||
loc!(specialize(EExpr::Str, string_literal_help())),
|
loc!(specialize(EExpr::Str, string_literal_help())),
|
||||||
loc!(specialize(EExpr::Number, positive_number_literal_help())),
|
loc!(specialize(EExpr::Number, positive_number_literal_help())),
|
||||||
loc!(specialize(EExpr::Lambda, closure_help(min_indent))),
|
loc!(specialize(EExpr::Lambda, closure_help(min_indent))),
|
||||||
|
|
|
@ -254,7 +254,6 @@ fn end_of_file<'a>() -> impl Parser<'a, (), SyntaxError<'a>> {
|
||||||
if state.has_reached_end() {
|
if state.has_reached_end() {
|
||||||
Ok((NoProgress, (), state))
|
Ok((NoProgress, (), state))
|
||||||
} else {
|
} else {
|
||||||
dbg!(state);
|
|
||||||
Err((
|
Err((
|
||||||
NoProgress,
|
NoProgress,
|
||||||
SyntaxError::NotEndOfFile(state.line, state.column),
|
SyntaxError::NotEndOfFile(state.line, state.column),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue