mirror of
https://github.com/roc-lang/roc.git
synced 2025-07-31 10:23:54 +00:00
Only annotation spaces should be backtrackable
This commit is contained in:
parent
4b8b36529d
commit
56f12718f1
1 changed files with 5 additions and 2 deletions
|
@ -1050,7 +1050,7 @@ fn import_ingested_file_body<'a>() -> impl Parser<'a, ValueDef<'a>, EImport<'a>>
|
|||
string_literal::parse_str_literal()
|
||||
)),
|
||||
name: import_ingested_file_as(),
|
||||
annotation: optional(backtrackable(import_ingested_file_annotation()))
|
||||
annotation: optional(import_ingested_file_annotation())
|
||||
}),
|
||||
ValueDef::IngestedFileImport
|
||||
)
|
||||
|
@ -1077,7 +1077,10 @@ fn import_ingested_file_as<'a>(
|
|||
fn import_ingested_file_annotation<'a>() -> impl Parser<'a, IngestedFileAnnotation<'a>, EImport<'a>>
|
||||
{
|
||||
record!(IngestedFileAnnotation {
|
||||
before_colon: skip_second!(space0_e(EImport::IndentColon), byte(b':', EImport::Colon)),
|
||||
before_colon: skip_second!(
|
||||
backtrackable(space0_e(EImport::IndentColon)),
|
||||
byte(b':', EImport::Colon)
|
||||
),
|
||||
annotation: specialize_err(EImport::Annotation, type_annotation::located(false))
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue