Skip to content

Commit

Permalink
Merge pull request #770 from epage/context
Browse files Browse the repository at this point in the history
perf(parser): Reduce overhead from error reporting
  • Loading branch information
epage authored Jul 29, 2024
2 parents d29eb7a + e257b42 commit d507db2
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions crates/toml_edit/src/parser/strings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,10 @@ fn ml_basic_string<'i>(input: &mut Input<'i>) -> PResult<Cow<'i, str>> {
"ml-basic-string",
delimited(
ML_BASIC_STRING_DELIM,
preceded(opt(newline), cut_err(ml_basic_body)),
cut_err(ML_BASIC_STRING_DELIM),
)
.context(StrContext::Label("multiline basic string")),
preceded(opt(newline), cut_err(ml_basic_body))
.context(StrContext::Label("multiline basic string")),
cut_err(ML_BASIC_STRING_DELIM).context(StrContext::Label("multiline basic string")),
),
)
.parse_next(input)
}
Expand Down Expand Up @@ -296,10 +296,10 @@ fn ml_literal_string<'i>(input: &mut Input<'i>) -> PResult<Cow<'i, str>> {
} else {
Cow::Borrowed(t)
}
})),
cut_err(ML_LITERAL_STRING_DELIM),
)
.context(StrContext::Label("multiline literal string")),
}))
.context(StrContext::Label("multiline literal string")),
cut_err(ML_LITERAL_STRING_DELIM).context(StrContext::Label("multiline literal string")),
),
)
.parse_next(input)
}
Expand Down

0 comments on commit d507db2

Please sign in to comment.