mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 12:18:19 +00:00
Move backtracking for implements to specific spaces case that it's actually needed for, to avoid excess parsing work in extreme cases
This commit is contained in:
parent
6edfc0aa90
commit
090473434d
4 changed files with 6 additions and 24 deletions
|
@ -186,7 +186,7 @@ where
|
|||
E: 'a + SpaceProblem,
|
||||
{
|
||||
parser::map(
|
||||
and(space0_e(indent_problem), parser),
|
||||
and(backtrackable(space0_e(indent_problem)), parser),
|
||||
|(space_list, item): (&'a [CommentOrNewline<'a>], S)| SpacesBefore {
|
||||
before: space_list,
|
||||
item,
|
||||
|
|
|
@ -1163,10 +1163,7 @@ fn opaque_signature<'a>(
|
|||
and(
|
||||
specialize_err(EExpr::Type, type_annotation::located_opaque_signature(true)),
|
||||
optional(map_with_arena(
|
||||
backtrackable(specialize_err(
|
||||
EExpr::Type,
|
||||
type_annotation::implements_abilities(),
|
||||
)),
|
||||
specialize_err(EExpr::Type, type_annotation::implements_abilities()),
|
||||
|arena, item| &*arena.alloc(item),
|
||||
)),
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue